-
Notifications
You must be signed in to change notification settings - Fork 3
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
contract: add erc20 functions #100
base: main
Are you sure you want to change the base?
Conversation
|
.github/workflows/_measure-gas.yml
Outdated
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.
a lot of commented jobs - I guess this is something to be restored
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.
Assuming it's doable in this PR, not sure what breaks if we restore it now. We might prefer leaving a TODO and/or JIRA (sub)task.
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.
I commented it cause the new binary for gas measurement is not compatible with main branch contracts
https://github.com/Cardinal-Cryptography/zkOS-monorepo/actions/runs/13071400613/job/36473677457
This can be fixed with compiling the additional binary on the main branch. Not sure if it's worth doing, what do you suggest?
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.
Any decision that ensures we don't forget about restoring the commented-out part is fine by me. Leaving this for @pmikolajczyk41 to weigh in.
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.
this PR is already huge; I'd suggest adding Jira ticket and solving this in a follow-up
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.
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.
Awesome!
Haven't read everything, but posting some initial comments. Will finish reviewing today.
.github/workflows/_measure-gas.yml
Outdated
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.
Assuming it's doable in this PR, not sure what breaks if we restore it now. We might prefer leaving a TODO and/or JIRA (sub)task.
crates/integration-tests/src/shielder/calls/new_account_native.rs
Outdated
Show resolved
Hide resolved
crates/integration-tests/src/shielder/calls/new_account_native.rs
Outdated
Show resolved
Hide resolved
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.
nice work, kudos!
for future, I'd suggest doing preliminary, no-brainer PR for simply renaming contract functions and applying this to >20 files, and then, proper PR with semantic changes
bytes3 public constant CONTRACT_VERSION = 0x000001; | ||
bytes3 public constant CONTRACT_VERSION = 0x000100; |
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.
just out of curiosity - have we already decided that the new version is 0.1.0, not 0.0.2? (apart from this PR ofc :P)
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 agreement was that if circuits get updated, the middle (or the first) number gets bumped.
@@ -313,4 +323,40 @@ contract Shielder is | |||
function setDepositLimit(uint256 _depositLimit) external onlyOwner { | |||
_setDepositLimit(_depositLimit); | |||
} | |||
|
|||
function handleTokenTransferIn( |
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.
+1 for these handlers
contracts/Shielder.sol
Outdated
} else { | ||
IERC20 token = IERC20(tokenAddress); | ||
bool transferSuccess = token.transfer(to, amount); | ||
if (!transferSuccess) revert NativeTransferFailed(); |
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.
new error is needed here (not native transfer)
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.
added ERC20TransferFailed
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.
LGTM
.github/workflows/_measure-gas.yml
Outdated
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.
No description provided.