-
Notifications
You must be signed in to change notification settings - Fork 241
Add builder codes PR #538
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
base: master
Are you sure you want to change the base?
Add builder codes PR #538
Conversation
🟡 Heimdall Review Status
|
| (address user, bytes32 code, uint16 feeBps) | ||
| ``` | ||
|
|
||
| - `user` → The user address on Base (NOT the Twin contract address) |
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.
Maybe we could be more explicit here. user is really just the intended recipient address on Base.
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.
updated
| ``` | ||
|
|
||
| <Note> | ||
| **Why `to = BRIDGE_CAMPAIGN_ADDRESS`?** Because the tokens must arrive at the Bridge campaign first; `Flywheel.send(...)` attributes the action before the campaign forwards/finalizes as designed. |
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 key point is: when using a builder code, the token transfer must send the tokens to BRIDGE_CAMPAIGN_ADDRESS. That contract will then forward the tokens to the intended user (recipient).
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.
updated - thanks
| data: abi.encodeWithSelector(Counter.increment.selector) | ||
| ``` | ||
|
|
||
| **With builder code** (prepend Flywheel + keep Counter call): Wrap both calls in a `Multicall` executed by `DelegateCall` from the Twin contract context. |
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.
We could revisit this once we’ve deployed CBMulticall on Base mainnet and Sepolia. For now, let’s link this contract from our current implementation, and later we can add the deployment addresses.
Maybe we could add a small description on why CBMulticall is recommended here instead of the canonical Multicall (because we want to support doing delegate calls with values).
Co-authored-by: xenoliss <[email protected]>
Co-authored-by: xenoliss <[email protected]>
Co-authored-by: xenoliss <[email protected]>
Co-authored-by: xenoliss <[email protected]>
Co-authored-by: xenoliss <[email protected]>
Co-authored-by: xenoliss <[email protected]>
What changed? Why?
Adding Builder Codes section to the docs