Skip to content

api+#1

Open
BTCandETHaa wants to merge 1 commit intogemini-crypto:masterfrom
BTCandETHaa:patch-2
Open

api+#1
BTCandETHaa wants to merge 1 commit intogemini-crypto:masterfrom
BTCandETHaa:patch-2

Conversation

@BTCandETHaa
Copy link

/* Send coins */
function transfer(address _to, uint256 _value) {
if (_to == 0x0) throw; // Prevent transfer to 0x0 address. Use burn() instead
if (_value <= 0) throw;
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
balanceOf[msg.sender] = SafeMath.safeSub(balanceOf[msg.sender], _value); // Subtract from the sender
balanceOf[_to] = SafeMath.safeAdd(balanceOf[_to], _value); // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}

/* Allow another contract to spend some tokens in your behalf */
function approve(address _spender, uint256 _value)
    returns (bool success) {
	if (_value <= 0) throw; 
    allowance[msg.sender][_spender] = _value;
    return true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant