-
Notifications
You must be signed in to change notification settings - Fork 11
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: upgrade to ethers v6 #491
Conversation
})) as TablelandTables | ||
).deployed(); | ||
console.log("New proxy address:", tables.address); | ||
// @ts-expect-error ignore `Conversion of type 'Contract'` error since |
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 tried to get around this error but couldn't. the type that deployProxy
says it should return is an ethers Contract
, but if you log it, it's a BaseContract
—which is what TablelandTables
extends. ignoring it resolved the issue.
|
||
// Check implementation | ||
// Note: We poll here because the impl won't be visible from the proxy until the next tipset on Filecoin. | ||
// Note: See https://docs.filecoin.io/smart-contracts/developing-contracts/best-practices/#consistently-generating-transaction-receipts. | ||
const startTime = Date.now(); | ||
while (!(await checkImpl(tables.address))) { | ||
while (!(await checkImpl(await tables.getAddress()))) { |
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 new way to get an addr is via method call
const tableId = createEvent.args!.tableId; | ||
console.log("Healthbot table created as:", `healthbot_${chainId}_${tableId}`); | ||
|
||
// Insert first row into health bot table | ||
const runStatement = `insert into healthbot_${chainId}_${tableId} values (1);`; | ||
// Add 20% buffer to gas limit to avoid out-of-gas errors |
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.
txs were failing when i tried to deploy to a live network, i.e., sepolia. the gas limit was hitting 99%+. this adds a buffer and fixed the issue.
@@ -0,0 +1,5 @@ | |||
import type { EventLog, Log } from "ethers"; |
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 response from receipt?.logs
(see above) is now a Log
or EventLog
, so we need to make sure we only get the EventLog
in order to parse
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.
very nice!
Newest hardhat doesnt support Node 16: https://hardhat.org/hardhat-runner/docs/reference/stability-guarantees#node.js-versions-support
398b812
to
8e8584c
Compare
@sanderpick realized i didn't add tests here since i was rushing to test amoy support 😅 ...added. also, hardhat dropped node 16 support, so i updated the gh action to use node 18 (and technically, they say they only support node LTS). |
Summary
Bumps ethers to v6—plus, OpenZepplin and Hardhat packages that need v6 as a peer dependency.
Details
N/A
How it was tested
Tested deployment scripts:
Checklist: