Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mistake in require condition in docs #15057

Merged
merged 1 commit into from Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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