@@ -94,8 +94,9 @@ function getStorage() pure returns (ERC20Storage storage s) {
9494 * @param _from The address to send tokens from.
9595 * @param _to The address to send tokens to.
9696 * @param _value The number of tokens to transfer.
97+ * @return True if the transfer was successful.
9798 */
98- function transferFrom (address _from , address _to , uint256 _value ) {
99+ function transferFrom (address _from , address _to , uint256 _value ) returns ( bool ) {
99100 ERC20Storage storage s = getStorage ();
100101 if (_from == address (0 )) {
101102 revert ERC20InvalidSender (address (0 ));
@@ -119,15 +120,17 @@ function transferFrom(address _from, address _to, uint256 _value) {
119120 }
120121 s.balanceOf[_to] += _value;
121122 emit Transfer (_from, _to, _value);
123+ return true ;
122124}
123125
124126/**
125127 * @notice Transfers tokens from the caller to another address.
126128 * @dev Updates balances directly without allowance mechanism.
127129 * @param _to The address to send tokens to.
128130 * @param _value The number of tokens to transfer.
131+ * @return True if the transfer was successful.
129132 */
130- function transfer (address _to , uint256 _value ) {
133+ function transfer (address _to , uint256 _value ) returns ( bool ) {
131134 ERC20Storage storage s = getStorage ();
132135 if (_to == address (0 )) {
133136 revert ERC20InvalidReceiver (address (0 ));
@@ -141,5 +144,6 @@ function transfer(address _to, uint256 _value) {
141144 }
142145 s.balanceOf[_to] += _value;
143146 emit Transfer (msg .sender , _to, _value);
147+ return true ;
144148}
145149
0 commit comments