Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: SafeErc20 utility #289
base: main
Are you sure you want to change the base?
feat: SafeErc20 utility #289
Changes from 53 commits
98e0660
025dc51
3db1217
2287251
eb779f1
3182cc6
a3a4673
05b235f
9e449f4
025564a
019ef51
33ef805
ef2b0c8
8041c47
e4ba4e5
1a47709
e978a6b
6e10c60
970e3cf
22092da
1ed10b1
429b42d
1348579
3542d32
b6ccccf
c42aa9d
89240e6
282e9f9
23ca2af
53ab7f0
bcf1374
29ea3b4
423743b
d47db5a
bf1915a
2b79af1
306ec74
b88ee72
19f3448
a7dd96d
bc7dc15
d3bb6ec
8dd894e
8739ec6
5db49ad
8ed5249
c90bee0
03f1777
3168ec2
e5736ff
05f3e1a
a5e803c
e3b2782
ef3dba3
86f352c
7034914
a4c21fb
34eda9f
fde3b18
06d8112
08d5ac6
ee6beb4
e325745
839517b
f006d42
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, RawCall is unsafe and should be called with
flush_storage_cache
when reentrancy is enabled. Let me know how you'd like to do this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I opted for
RawCall
here is that it enables us to set the return data size to just 32 bytes, which assumes the underlying ERC20 returns a boolean. It also does not make assumptions about the return value of the underlying ERC20.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really clear to me whether explicitly setting the gas remaining is necessary, so I set it just in case.