Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci-turbo-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +29 to 34
Copy link
Contributor Author

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.

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
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci-turbo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/publish-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
name: Publish Javascript Packages to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
Expand All @@ -18,10 +19,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: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
Expand Down
1 change: 1 addition & 0 deletions apps/developer-hub/next-env.d.ts
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" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
16 changes: 13 additions & 3 deletions contract_manager/scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ export async function deployIfNotCached(
const key = cacheKey ?? `${chain.getId()}-${artifactName}`;
return runIfNotCached(key, async () => {
const artifact = JSON.parse(
readFileSync(join(config.jsonOutputDir, `${artifactName}.json`), "utf8"),
readFileSync(
join(
config.jsonOutputDir,
`${artifactName}.sol`,
`${artifactName}.json`,
),
"utf8",
),
);

// Handle bytecode which can be either a string or an object with an 'object' property
Expand Down Expand Up @@ -74,7 +81,10 @@ export function getWeb3Contract(
address: string,
): Contract {
const artifact = JSON.parse(
readFileSync(join(jsonOutputDir, `${artifactName}.json`), "utf8"),
readFileSync(
join(jsonOutputDir, `${artifactName}.sol`, `${artifactName}.json`),
"utf8",
),
);
const web3 = new Web3();
return new web3.eth.Contract(artifact["abi"], address);
Expand All @@ -84,7 +94,7 @@ export const COMMON_DEPLOY_OPTIONS = {
"std-output-dir": {
type: "string",
demandOption: true,
desc: "Path to the standard JSON output of the contracts (build artifact) directory",
desc: "Path to the Foundry output directory (contains Contract.sol/Contract.json structure)",
},
"private-key": {
type: "string",
Expand Down
2 changes: 1 addition & 1 deletion contract_manager/scripts/deploy_evm_lazer_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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}`);
Expand Down
19 changes: 16 additions & 3 deletions contract_manager/scripts/transfer_balance_entropy_chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ async function transferOnChain(
transferAmountEth = transferAmount;
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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`,
Expand Down Expand Up @@ -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:`);
Expand Down
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" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Loading
Loading