Skip to content

Commit

Permalink
Merge pull request #15057 from ethereum/require-docs-fixup
Browse files Browse the repository at this point in the history
Fix mistake in require condition in docs
  • Loading branch information
nikola-matic committed Apr 26, 2024
2 parents 24e3c30 + ceabc54 commit 938c505
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/contracts/errors.rst
Expand Up @@ -40,7 +40,7 @@ as well as the newer approach with ``require`` in function ``transferWithRequire
balance[to] += amount;
}
function transferWithRequireError(address to, uint256 amount) public {
require(amount > balance[msg.sender], InsufficientBalance(balance[msg.sender], amount));
require(amount <= balance[msg.sender], InsufficientBalance(balance[msg.sender], amount));
balance[msg.sender] -= amount;
balance[to] += amount;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction-to-smart-contracts.rst
Expand Up @@ -119,7 +119,7 @@ registering with a username and password, all you need is an Ethereum keypair.
// Sends an amount of existing coins
// from any caller to an address
function send(address receiver, uint amount) public {
require(amount > balances[msg.sender], InsufficientBalance(amount, balances[msg.sender]));
require(amount <= balances[msg.sender], InsufficientBalance(amount, balances[msg.sender]));
balances[msg.sender] -= amount;
balances[receiver] += amount;
emit Sent(msg.sender, receiver, amount);
Expand Down

0 comments on commit 938c505

Please sign in to comment.