-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support for non-18 decimals in custom fee token #24
Conversation
pushed a nodejs v18 commit to |
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.
seems good. One small suggestion but not a must.
scripts/ethcommands.ts
Outdated
@@ -77,14 +82,42 @@ async function bridgeNativeToken(argv: any, parentChainUrl: string, chainUrl: st | |||
const sleep = (ms: number) => new Promise(r => setTimeout(r, ms)); | |||
while (true) { | |||
const balance = await bridger.getBalance() | |||
if (balance.gte(ethers.utils.parseEther(argv.amount))) { | |||
if (balance.gte(0)) { |
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.
.gte(depositAmount)?
gte(0) will not work for 2nd transfer, gte(depositAmount) will at least work if 2nd transfer is larger than previous balance which seems reasonable.
there are probably better ways
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.
In case when fee token has non-18 decimals, depositAmount is not equal to the amount minted on L2 (we do inflation/deflation to match 18-decimals denomination for native currency). I've improved this check to properly wait for expected amount to be minted on L2 3af86a0
Set simple is false when running espresso
Add
--l3-fee-token-decimals
flag to support custom number of decimals in Orbit's fee token.Ie. this will spin up an Orbit chain with 6 decimals fee token: