-
Notifications
You must be signed in to change notification settings - Fork 300
feat(contracts): remove truffle and replace with foundry #2973
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
Changes from all commits
e65f9f4
3d3c2be
12c78e2
b58f29c
869689f
372fbdf
deb9023
9a421e6
2574f75
e55f175
3837745
df83149
7f13fa8
f08a0b3
9e19455
5935c1d
8075795
68b3d81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,17 @@ jobs: | |
# precompiled binary isn't found. | ||
- name: Install libusb | ||
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev | ||
# Install Foundry for Ethereum contract builds | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: v0.3.0 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
run_install: true | ||
- name: Install Forge dependencies | ||
run: cd target_chains/ethereum/contracts && pnpm run install-forge-deps | ||
- name: Cache for Turbo | ||
uses: rharkor/[email protected] | ||
- name: Build | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: "package.json" | ||
|
@@ -25,10 +26,17 @@ jobs: | |
# precompiled binary isn't found. | ||
- name: Install libusb | ||
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev | ||
# Install Foundry for Ethereum contract tests | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: v0.3.0 | ||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
run_install: true | ||
- name: Install Forge dependencies | ||
run: cd target_chains/ethereum/contracts && pnpm run install-forge-deps | ||
- name: Cache for Turbo | ||
uses: rharkor/[email protected] | ||
- name: Test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference path="./.next/types/routes.d.ts" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Through format fixing. |
||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,7 +323,7 @@ export async function main() { | |
console.log(`\n✅ Contract deployed at: ${deployedAddress}`); | ||
console.log(`Trusted signer updated: ${argv["update-signer"]}`); | ||
console.log( | ||
`Expires at: ${new Date(argv["expires-at"]! * 1000).toISOString()}`, | ||
`Expires at: ${new Date((argv["expires-at"] ?? 0) * 1000).toISOString()}`, | ||
); | ||
Comment on lines
-326
to
327
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These needs to be fixed here as the linter was failing with error. |
||
} else if (argv.deploy) { | ||
console.log(`Contract deployed at ${deployedAddress}`); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,7 +157,12 @@ async function transferOnChain( | |
transferAmountEth = transferAmount; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These needs to be fixed here as the linter was failing with error. |
||
} else { | ||
// transferRatio is guaranteed to be defined at this point | ||
transferAmountEth = (balanceEth - gasCostEth) * transferRatio!; | ||
if (transferRatio === undefined) { | ||
throw new Error( | ||
"Transfer ratio must be defined when amount is not specified", | ||
); | ||
} | ||
transferAmountEth = (balanceEth - gasCostEth) * transferRatio; | ||
} | ||
|
||
// Round to 10 decimal places to avoid Web3 conversion errors | ||
|
@@ -299,7 +304,12 @@ function getSelectedChains(argv: { | |
); | ||
selectedChains = []; | ||
|
||
for (const chainId of argv.chain!) { | ||
if (!argv.chain) { | ||
throw new Error( | ||
"Chain argument must be defined for specific chain selection", | ||
); | ||
} | ||
for (const chainId of argv.chain) { | ||
if (!entropyChainIds.has(chainId)) { | ||
throw new Error( | ||
`Chain ${chainId} does not have entropy contracts deployed`, | ||
|
@@ -360,7 +370,10 @@ async function main() { | |
if (argv.amount !== undefined) { | ||
transferMethod = `${argv.amount} ETH (fixed amount)`; | ||
} else { | ||
transferMethod = `${(argv.ratio! * 100).toFixed(1)}% of available balance`; | ||
if (argv.ratio === undefined) { | ||
throw new Error("Ratio must be defined when amount is not specified"); | ||
} | ||
transferMethod = `${(argv.ratio * 100).toFixed(1)}% of available balance`; | ||
} | ||
|
||
console.log(`\nConfiguration:`); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference path="./.next/types/routes.d.ts" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. format fix as test was failing in CI |
||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. |
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.
github workflows is updated as now part of build/test we will run forge commands.