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

Add ERC20 Permit (EIP-2612) #2237

Merged
merged 38 commits into from
Dec 11, 2020
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
19a413a
Initial storage-based implementation
nventuro May 15, 2020
48c41df
Improve gas efficiency and docs
nventuro May 15, 2020
d1e0f4b
Initial sketch for tests
nventuro May 15, 2020
cf718ee
Fix encoding before hash
nventuro May 26, 2020
53516bc
Implement nonce using Counter
nventuro Jun 5, 2020
be37397
Merge branch 'master' into erc20-permit
frangio Nov 20, 2020
743fe9a
adjust pragma and add license
frangio Nov 20, 2020
0c02fdc
adapt test to buidler
frangio Nov 20, 2020
255e11a
disable eslint in wip file
frangio Nov 20, 2020
d5037d2
add solhint exceptions
frangio Nov 20, 2020
b11d7ab
use a cheaper strategy for domain separator caching
frangio Nov 27, 2020
58c7098
add DOMAIN_SEPARATOR function
frangio Dec 1, 2020
1bd9922
Merge branch 'master' into erc20-permit
frangio Dec 1, 2020
cb00f8a
add eip712 from #2418
frangio Dec 1, 2020
c5d01e9
move to drafts directory
frangio Dec 1, 2020
aacea0c
use EIP712 contract
frangio Dec 1, 2020
b57f655
fix test
frangio Dec 2, 2020
0560ea8
emit contract in api/drafts page
frangio Dec 2, 2020
4552f52
fix api/drafts page title
frangio Dec 2, 2020
9a916f7
add constructor documentation
frangio Dec 2, 2020
91e98a4
lint
frangio Dec 2, 2020
e331820
extract eip712 helpers
frangio Dec 4, 2020
ade3af2
test DOMAIN_SEPARATOR function
frangio Dec 4, 2020
9a661c9
test permit postconditions
frangio Dec 4, 2020
f4b7f93
use different account for nonce test
frangio Dec 4, 2020
8f7f47c
add test for rejected transaction
frangio Dec 4, 2020
b7b5abd
test expired permit
frangio Dec 4, 2020
24e4582
remove note about domain separator and chain id
frangio Dec 4, 2020
737fa3b
Merge remote-tracking branch 'upstream/master' into erc20-permit
frangio Dec 4, 2020
f410734
ensure deadline is before next block timestamp
frangio Dec 4, 2020
9d60a71
Update contracts/token/ERC20/README.adoc
frangio Dec 9, 2020
3beaf01
add test that reused signature is rejected
frangio Dec 9, 2020
837586d
use valid signature when testing expired deadline
frangio Dec 9, 2020
add4067
Merge remote-tracking branch 'upstream/master' into erc20-permit
frangio Dec 9, 2020
f26f0e3
rename IERC2612Permit to IERC20Permit
frangio Dec 9, 2020
acd82cd
review documentation
frangio Dec 9, 2020
4444d3b
Merge branch 'master' into erc20-permit
frangio Dec 11, 2020
71c9e3d
add changelog entry
frangio Dec 11, 2020
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
Prev Previous commit
Next Next commit
test permit postconditions
  • Loading branch information
frangio committed Dec 4, 2020
commit 9a661c99fade88bfc76629553a2efcfdb00ce7b9
3 changes: 3 additions & 0 deletions test/drafts/ERC20Permit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@ contract('ERC20Permit', function (accounts) {
const { v, r, s } = fromRpcSig(signature);

const receipt = await this.token.permit(owner, spender, value, deadline, v, r, s);

expect(await this.token.nonces(owner)).to.be.bignumber.equal('1');
expect(await this.token.allowance(owner, spender)).to.be.bignumber.equal(value);
});
});