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

♻️ Make ERC1155 Module-Friendly #238

Merged
merged 4 commits into from
Apr 22, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 142 additions & 144 deletions .gas-snapshot

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
architecture:
- x64
python_version:
- 3.12
- 3.11

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
architecture:
- x64
python_version:
- 3.12
- 3.11

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
architecture:
- x64
python_version:
- 3.12
- 3.11
node_version:
- 20

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- **Tokens**
- [`ERC20`](https://github.com/pcaversaccio/snekmate/blob/v0.1.0/src/snekmate/tokens/ERC20.vy): Make `ERC20` module-friendly. ([#234](https://github.com/pcaversaccio/snekmate/pull/234))
- [`ERC721`](https://github.com/pcaversaccio/snekmate/blob/v0.1.0/src/snekmate/tokens/ERC721.vy): Make `ERC721` module-friendly. ([#237](https://github.com/pcaversaccio/snekmate/pull/237))
- [`ERC1155`](https://github.com/pcaversaccio/snekmate/blob/v0.1.0/src/snekmate/tokens/ERC1155.vy): Make `ERC1155` module-friendly. ([#238](https://github.com/pcaversaccio/snekmate/pull/238))
- **Utility Functions**
- [`Base64`](https://github.com/pcaversaccio/snekmate/blob/v0.1.0/src/snekmate/utils/Base64.vy): Make `Base64` module-friendly. ([#222](https://github.com/pcaversaccio/snekmate/pull/222))
- [`BatchDistributor`](https://github.com/pcaversaccio/snekmate/blob/v0.1.0/src/snekmate/utils/BatchDistributor.vy): Make `BatchDistributor` module-friendly. ([#223](https://github.com/pcaversaccio/snekmate/pull/223))
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ src
│ │ └── IERC4906 — "EIP-4906 Interface Definition"
│ └── mocks
│ ├── ERC20Mock — "ERC20 Module Reference Implementation"
│ └── ERC721Mock — "ERC721 Module Reference Implementation"
│ ├── ERC721Mock — "ERC721 Module Reference Implementation"
│ └── ERC1155Mock — "ERC1155 Module Reference Implementation"
└── utils
├── Base64 — "Base64 Encoding and Decoding Functions"
├── BatchDistributor — "Batch Sending Both Native and ERC-20 Tokens"
Expand Down
4 changes: 2 additions & 2 deletions src/snekmate/extensions/ERC4626.vy
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def permit(owner: address, spender: address, amount: uint256, deadline: uint256,
@notice See {ERC20-permit} for the function
docstring.
"""
assert block.timestamp <= deadline, "ERC20Permit: expired deadline"
assert block.timestamp <= deadline, "ERC20: expired deadline"

current_nonce: uint256 = self.nonces[owner]
self.nonces[owner] = unsafe_add(current_nonce, 1)
Expand All @@ -328,7 +328,7 @@ def permit(owner: address, spender: address, amount: uint256, deadline: uint256,
hash: bytes32 = self._hash_typed_data_v4(struct_hash)

signer: address = self._recover_vrs(hash, convert(v, uint256), convert(r, uint256), convert(s, uint256))
assert signer == owner, "ERC20Permit: invalid signature"
assert signer == owner, "ERC20: invalid signature"

self._approve(owner, spender, amount)

Expand Down
Loading