Skip to content

Commit 15a1a38

Browse files
authored
Fix link
1 parent c881349 commit 15a1a38

File tree

1 file changed

+3
-3
lines changed
  • public/content/developers/tutorials/erc20-with-safety-rails

1 file changed

+3
-3
lines changed

public/content/developers/tutorials/erc20-with-safety-rails/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you want to see the complete source code:
2323

2424
## Creating an ERC-20 contract {#creating-an-erc-20-contract}
2525

26-
Before we can add the safety rail functionality we need an ERC-20 contract. In this article we'll use [the OpenZeppelin Contracts Wizard](https://docs.openzeppelin.com/contracts/4.x/wizard). Open it in another browser and follow these instructions:
26+
Before we can add the safety rail functionality we need an ERC-20 contract. In this article we'll use [the OpenZeppelin Contracts Wizard](https://docs.openzeppelin.com/contracts/5.x/wizard). Open it in another browser and follow these instructions:
2727

2828
1. Select **ERC20**.
2929
2. Enter these settings:
@@ -92,7 +92,7 @@ We want to add these requirements to the function:
9292

9393
- The `to` address cannot equal `address(this)`, the address of the ERC-20 contract itself.
9494
- The `to` address cannot be empty, it has to be either:
95-
- An externally owned accounts (EOA). We can't check if an address is an EOA directly, but we can check an address's ETH balance. EOAs almost always have a balance, even if they are no longer used - it's difficult to clear them to the last wei.
95+
- An externally owned account (EOA). We can't check if an address is an EOA directly, but we can check an address's ETH balance. EOAs almost always have a balance, even if they are no longer used - it's difficult to clear them to the last wei.
9696
- A smart contract. Testing if an address is a smart contract is a bit harder. There is an opcode that checks the external code length, called [`EXTCODESIZE`](https://www.evm.codes/#3b), but it is not available directly in Solidity. We have to use [Yul](https://docs.soliditylang.org/en/v0.8.15/yul.html), which is EVM assembly, for it. There are other values we could use from Solidity ([`<address>.code` and `<address>.codehash`](https://docs.soliditylang.org/en/v0.8.15/units-and-global-variables.html#members-of-address-types)), but they cost more.
9797

9898
Lets go over the new code line by line:
@@ -209,4 +209,4 @@ This is a cleanup function, so presumably we don't want to leave any tokens. Ins
209209

210210
## Conclusion {#conclusion}
211211

212-
This is not a perfect solution - there is no perfect solution for the "user made a mistake" problem. However, using these kind of checks can at least prevent some mistakes. The ability to freeze accounts, while dangerous, can be used to limit the damage of certain hacks by denying the hacker the stolen funds.
212+
This is not a perfect solution - there is no perfect solution for the "user made a mistake" problem. However, using these kinds of checks can at least prevent some mistakes. The ability to freeze accounts, while dangerous, can be used to limit the damage of certain hacks by denying the hacker the stolen funds.

0 commit comments

Comments
 (0)