Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Martín Triay <martriay@gmail.com>
  • Loading branch information
andrew-fleming and martriay committed Jul 15, 2022
1 parent 0128e7e commit caf886d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/ERC721.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Following the [contracts extensibility pattern](Extensibility.md), this implemen
Just be sure that the exposed `external` methods invoke their imported function logic a la `approve` invokes `ERC721.approve`. As an example, see below.

```python
from openzeppelin.token.erc721.library.ERC721 import ERC721
from openzeppelin.token.erc721.library import ERC721

@external
func approve{
Expand Down
4 changes: 2 additions & 2 deletions docs/Introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In order to ensure EVM/StarkNet compatibility, interface identifiers are not cal
For a contract to declare its support for a given interface, the contract should import the ERC165 library and register its support. It's recommended to register interface support upon contract deployment through a constructor either directly or indirectly (as an initializer) like this:

```cairo
from openzeppelin.introspection.library.ERC165 import ERC165
from openzeppelin.introspection.erc165.library import ERC165
INTERFACE_ID = 0x12345678
Expand All @@ -52,7 +52,7 @@ end
To query a target contract's support for an interface, the querying contract should call `supportsInterface` through IERC165 with the target contract's address and the queried interface id. Here's an example:

```cairo
from openzeppelin.introspection.interfaces.IERC165 import IERC165
from openzeppelin.introspection.erc165.IERC165 import IERC165
INTERFACE_ID = 0x12345678
Expand Down
8 changes: 4 additions & 4 deletions docs/Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The Initializable library provides a simple mechanism that mimics the functional
The recommended pattern with Initializable is to include a check that the Initializable state is `False` and invoke `initialize` in the target function like this:

```cairo
from openzeppelin.security.library.Initializable import Initializable
from openzeppelin.security.initializable.library import Initializable
@external
func foo{
Expand All @@ -44,7 +44,7 @@ The Pausable library allows contracts to implement an emergency stop mechanism.
To use the Pausable library, the contract should include `pause` and `unpause` functions (which should be protected). For methods that should be available only when not paused, insert `assert_not_paused`. For methods that should be available only when paused, insert `assert_paused`. For example:

```cairo
from openzeppelin.security.library.Pausable import Pausable
from openzeppelin.security.pausable.library import Pausable
@external
func whenNotPaused{
Expand Down Expand Up @@ -85,7 +85,7 @@ A [reentrancy attack](https://gus-tavo-guim.medium.com/reentrancy-attack-on-smar
Since Cairo does not support modifiers like Solidity, the [`reentrancy_guard`](../src/openzeppelin/security/reentrancyguard/library.cairo) library exposes two methods `_start` and `_end` to protect functions against reentrancy attacks. The protected function must call `ReentrancyGuard._start` before the first function statement, and `ReentrancyGuard._end` before the return statement, as shown below:

```cairo
from openzeppelin.security.library.ReentrancyGuard import ReentrancyGuard
from openzeppelin.security.reentrancyguard.library import ReentrancyGuard
func test_function{
syscall_ptr : felt*,
Expand All @@ -108,7 +108,7 @@ The SafeUint256 namespace in the [SafeMath library](../src/openzeppelin/security
Using SafeUint256 methods is rather straightforward. Simply import SafeUint256 and insert the arithmetic method like this:

```cairo
from openzeppelin.security.library.SafeMath import SafeUint256
from openzeppelin.security.safemath.library import SafeUint256
func add_two_uints{
syscall_ptr: felt*,
Expand Down

0 comments on commit caf886d

Please sign in to comment.