From 5b3dfe146b5a08a7840e8d5d459cd81abf0c2d49 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Thu, 19 Mar 2026 20:21:48 -0600 Subject: [PATCH 01/19] SP1 & USP changes for Tron compatibility --- .gitignore | 9 ++++++++- contracts/SpokePool.sol | 4 ++-- contracts/sp1-helios/SP1Helios.sol | 21 ++++++++++----------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 67215b0ec..8be0333bf 100644 --- a/.gitignore +++ b/.gitignore @@ -30,11 +30,14 @@ artifacts-zk out out-local out-tron +out-tron-universal +out-tron-spokepool zkout cache-foundry cache-foundry-local cache-foundry-tron - +cache-foundry-tron-universal +cache-foundry-tron-spokepool # Upgradeability files .openzeppelin @@ -59,5 +62,9 @@ src/svm/clients/* script/universal/genesis-binary script/universal/genesis.json +# Tron solc binary and flattened sources +bin/solc-tron +flattened/ + # claude CLAUDE.local.md diff --git a/contracts/SpokePool.sol b/contracts/SpokePool.sol index e82974636..851f47fee 100644 --- a/contracts/SpokePool.sol +++ b/contracts/SpokePool.sol @@ -1545,7 +1545,7 @@ abstract contract SpokePool is // Unwraps ETH and does a transfer to a recipient address. If the recipient is a smart contract then sends wrappedNativeToken. function _unwrapwrappedNativeTokenTo(address payable to, uint256 amount) internal { - if (!address(to).isContract() || _is7702DelegatedWallet(to)) { + if (!AddressLibUpgradeable.isContract(address(to)) || _is7702DelegatedWallet(to)) { wrappedNativeToken.withdraw(amount); AddressLibUpgradeable.sendValue(to, amount); } else { @@ -1667,7 +1667,7 @@ abstract contract SpokePool is } bytes memory updatedMessage = relayExecution.updatedMessage; - if (updatedMessage.length > 0 && recipientToSend.isContract()) { + if (updatedMessage.length > 0 && AddressLibUpgradeable.isContract(recipientToSend)) { AcrossMessageHandler(recipientToSend).handleV3AcrossMessage( outputToken, amountToSend, diff --git a/contracts/sp1-helios/SP1Helios.sol b/contracts/sp1-helios/SP1Helios.sol index f8100ca50..307b3511d 100644 --- a/contracts/sp1-helios/SP1Helios.sol +++ b/contracts/sp1-helios/SP1Helios.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.30; +pragma solidity ^0.8.20; import { ISP1Verifier } from "@sp1-contracts/src/ISP1Verifier.sol"; import { AccessControlEnumerable } from "@sp1-contracts/lib/openzeppelin-contracts/contracts/access/extensions/AccessControlEnumerable.sol"; @@ -171,24 +171,23 @@ contract SP1Helios is AccessControlEnumerable { uint256 fromHead = po.prevHead; // Ensure that po.newHead is strictly greater than po.prevHead - require(po.newHead > fromHead, NonIncreasingHead(po.newHead)); + if (po.newHead <= fromHead) revert NonIncreasingHead(po.newHead); bytes32 storedPrevHeader = headers[fromHead]; - require(storedPrevHeader != bytes32(0), PreviousHeaderNotSet(fromHead)); - require(storedPrevHeader == po.prevHeader, PreviousHeaderMismatch(po.prevHeader, storedPrevHeader)); + if (storedPrevHeader == bytes32(0)) revert PreviousHeaderNotSet(fromHead); + if (storedPrevHeader != po.prevHeader) revert PreviousHeaderMismatch(po.prevHeader, storedPrevHeader); // Check if the head being proved against is older than allowed. - require(block.timestamp - slotTimestamp(fromHead) <= MAX_SLOT_AGE, PreviousHeadTooOld(fromHead)); + if (block.timestamp - slotTimestamp(fromHead) > MAX_SLOT_AGE) revert PreviousHeadTooOld(fromHead); uint256 currentPeriod = getSyncCommitteePeriod(fromHead); // Note: We should always have a sync committee for the current head. // The "start" sync committee hash is the hash of the sync committee that should sign the next update. bytes32 currentSyncCommitteeHash = syncCommittees[currentPeriod]; - require( - currentSyncCommitteeHash == po.startSyncCommitteeHash, - SyncCommitteeStartMismatch(po.startSyncCommitteeHash, currentSyncCommitteeHash) - ); + if (currentSyncCommitteeHash != po.startSyncCommitteeHash) { + revert SyncCommitteeStartMismatch(po.startSyncCommitteeHash, currentSyncCommitteeHash); + } // Verify the proof with the associated public values. This will revert if proof invalid. ISP1Verifier(verifier).verifyProof(heliosProgramVkey, publicValues, proof); @@ -241,7 +240,7 @@ contract SP1Helios is AccessControlEnumerable { // If the next sync committee is already correct, we don't need to update it. if (syncCommittees[nextPeriod] != po.nextSyncCommitteeHash) { - require(syncCommittees[nextPeriod] == bytes32(0), SyncCommitteeAlreadySet(nextPeriod)); + if (syncCommittees[nextPeriod] != bytes32(0)) revert SyncCommitteeAlreadySet(nextPeriod); syncCommittees[nextPeriod] = po.nextSyncCommitteeHash; emit SyncCommitteeUpdate(nextPeriod, po.nextSyncCommitteeHash); @@ -256,7 +255,7 @@ contract SP1Helios is AccessControlEnumerable { bytes32 oldHeliosProgramVkey = heliosProgramVkey; heliosProgramVkey = newHeliosProgramVkey; - require(oldHeliosProgramVkey != newHeliosProgramVkey, VkeyNotChanged(newHeliosProgramVkey)); + if (oldHeliosProgramVkey == newHeliosProgramVkey) revert VkeyNotChanged(newHeliosProgramVkey); emit HeliosProgramVkeyUpdated(oldHeliosProgramVkey, newHeliosProgramVkey); } From 30f4b1a5c21daf78163be429aff753f7bcc97d83 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Fri, 20 Mar 2026 10:54:21 -0600 Subject: [PATCH 02/19] add auto verifier --- contracts/sp1-helios/SP1AutoVerifier.sol | 10 +++ test/evm/foundry/local/SP1AutoVerifier.t.sol | 76 ++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 contracts/sp1-helios/SP1AutoVerifier.sol create mode 100644 test/evm/foundry/local/SP1AutoVerifier.t.sol diff --git a/contracts/sp1-helios/SP1AutoVerifier.sol b/contracts/sp1-helios/SP1AutoVerifier.sol new file mode 100644 index 000000000..8b3fac968 --- /dev/null +++ b/contracts/sp1-helios/SP1AutoVerifier.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import { ISP1Verifier } from "@sp1-contracts/src/ISP1Verifier.sol"; + +/// @title SP1 Auto Verifier +/// @notice A no-op verifier that accepts any proof. Useful for testing SP1Helios without real proofs. +contract SP1AutoVerifier is ISP1Verifier { + function verifyProof(bytes32, bytes calldata, bytes calldata) external pure {} +} diff --git a/test/evm/foundry/local/SP1AutoVerifier.t.sol b/test/evm/foundry/local/SP1AutoVerifier.t.sol new file mode 100644 index 000000000..869fdfabb --- /dev/null +++ b/test/evm/foundry/local/SP1AutoVerifier.t.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import { Test } from "forge-std/Test.sol"; +import { SP1Helios } from "../../../../contracts/sp1-helios/SP1Helios.sol"; +import { SP1AutoVerifier } from "../../../../contracts/sp1-helios/SP1AutoVerifier.sol"; + +contract SP1AutoVerifierTest is Test { + SP1AutoVerifier autoVerifier; + SP1Helios helios; + address updater = address(0x2); + + uint256 constant GENESIS_TIME = 1606824023; + uint256 constant SECONDS_PER_SLOT = 12; + uint256 constant SLOTS_PER_EPOCH = 32; + uint256 constant SLOTS_PER_PERIOD = 8192; + bytes32 constant INITIAL_HEADER = bytes32(uint256(2)); + bytes32 constant INITIAL_EXECUTION_STATE_ROOT = bytes32(uint256(3)); + bytes32 constant INITIAL_SYNC_COMMITTEE_HASH = bytes32(uint256(4)); + bytes32 constant HELIOS_PROGRAM_VKEY = bytes32(uint256(5)); + uint256 constant INITIAL_HEAD = 100; + + function setUp() public { + autoVerifier = new SP1AutoVerifier(); + + address[] memory updaters = new address[](1); + updaters[0] = updater; + + helios = new SP1Helios( + SP1Helios.InitParams({ + executionStateRoot: INITIAL_EXECUTION_STATE_ROOT, + genesisTime: GENESIS_TIME, + head: INITIAL_HEAD, + header: INITIAL_HEADER, + heliosProgramVkey: HELIOS_PROGRAM_VKEY, + secondsPerSlot: SECONDS_PER_SLOT, + slotsPerEpoch: SLOTS_PER_EPOCH, + slotsPerPeriod: SLOTS_PER_PERIOD, + syncCommitteeHash: INITIAL_SYNC_COMMITTEE_HASH, + verifier: address(autoVerifier), + vkeyUpdater: address(0), + updaters: updaters + }) + ); + } + + function testVerifyProofNeverReverts() public view { + autoVerifier.verifyProof(bytes32(0), "", ""); + autoVerifier.verifyProof(bytes32(uint256(1)), "abc", "def"); + autoVerifier.verifyProof(HELIOS_PROGRAM_VKEY, abi.encode(uint256(42)), hex"deadbeef"); + } + + function testHeliosUpdateWithNonEmptyProof() public { + SP1Helios.StorageSlot[] memory slots = new SP1Helios.StorageSlot[](0); + SP1Helios.ProofOutputs memory po = SP1Helios.ProofOutputs({ + executionStateRoot: bytes32(uint256(11)), + newHeader: bytes32(uint256(10)), + nextSyncCommitteeHash: bytes32(0), + newHead: INITIAL_HEAD + 1, + prevHeader: INITIAL_HEADER, + prevHead: INITIAL_HEAD, + syncCommitteeHash: INITIAL_SYNC_COMMITTEE_HASH, + startSyncCommitteeHash: INITIAL_SYNC_COMMITTEE_HASH, + slots: slots + }); + + vm.warp(helios.slotTimestamp(INITIAL_HEAD) + 1 hours); + vm.prank(updater); + // Unlike SP1MockVerifier, non-empty proof bytes are accepted. + // Note: the ProofVerified event is NOT emitted here because SP1Helios calls verifyProof + // via staticcall (ISP1Verifier is view), which prevents state changes including events. + helios.update(hex"deadbeef", abi.encode(po)); + + assertEq(helios.head(), INITIAL_HEAD + 1); + } +} From 2eb9ef751ec67cc1e268f7057c8e7fe8cbc6ce12 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Fri, 20 Mar 2026 11:34:31 -0600 Subject: [PATCH 03/19] bump solidity versions to ^0.8.25 --- contracts/sp1-helios/SP1AutoVerifier.sol | 2 +- contracts/sp1-helios/SP1Helios.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/sp1-helios/SP1AutoVerifier.sol b/contracts/sp1-helios/SP1AutoVerifier.sol index 8b3fac968..a77b7737b 100644 --- a/contracts/sp1-helios/SP1AutoVerifier.sol +++ b/contracts/sp1-helios/SP1AutoVerifier.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.25; import { ISP1Verifier } from "@sp1-contracts/src/ISP1Verifier.sol"; diff --git a/contracts/sp1-helios/SP1Helios.sol b/contracts/sp1-helios/SP1Helios.sol index 307b3511d..ffdc1bcb1 100644 --- a/contracts/sp1-helios/SP1Helios.sol +++ b/contracts/sp1-helios/SP1Helios.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.25; import { ISP1Verifier } from "@sp1-contracts/src/ISP1Verifier.sol"; import { AccessControlEnumerable } from "@sp1-contracts/lib/openzeppelin-contracts/contracts/access/extensions/AccessControlEnumerable.sol"; From 51f490ecdf1e199460f7ce87b361efd8bbe2caa5 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Fri, 20 Mar 2026 14:12:40 -0600 Subject: [PATCH 04/19] add deploy scripts --- .gitignore | 2 + contracts/tron-universal/TronImports.sol | 9 + foundry.toml | 11 + package.json | 11 +- script/universal/tron/README.md | 149 +++++++++ script/universal/tron/deploy.ts | 306 ++++++++++++++++++ .../tron/tron-deploy-sp1-auto-verifier.ts | 38 +++ .../universal/tron/tron-deploy-sp1-helios.ts | 236 ++++++++++++++ .../tron/tron-deploy-universal-spokepool.ts | 101 ++++++ yarn.lock | 180 ++++++++++- 10 files changed, 1039 insertions(+), 4 deletions(-) create mode 100644 contracts/tron-universal/TronImports.sol create mode 100644 script/universal/tron/README.md create mode 100644 script/universal/tron/deploy.ts create mode 100644 script/universal/tron/tron-deploy-sp1-auto-verifier.ts create mode 100644 script/universal/tron/tron-deploy-sp1-helios.ts create mode 100644 script/universal/tron/tron-deploy-universal-spokepool.ts diff --git a/.gitignore b/.gitignore index 8be0333bf..6f887f429 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,8 @@ src/svm/clients/* # SP1Helios deploy artifacts script/universal/genesis-binary script/universal/genesis.json +script/universal/tron/genesis-binary +script/universal/tron/genesis.json # Tron solc binary and flattened sources bin/solc-tron diff --git a/contracts/tron-universal/TronImports.sol b/contracts/tron-universal/TronImports.sol new file mode 100644 index 000000000..4bcaca6f4 --- /dev/null +++ b/contracts/tron-universal/TronImports.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +// Entry point for the tron-universal Foundry profile. Importing these contracts here causes +// them (and their dependencies) to be compiled with Tron's solc (bin/solc-tron) and output +// to out-tron-universal/. +import "../sp1-helios/SP1Helios.sol"; +import "../sp1-helios/SP1AutoVerifier.sol"; +import "../Universal_SpokePool.sol"; diff --git a/foundry.toml b/foundry.toml index f270531b0..3597e910f 100644 --- a/foundry.toml +++ b/foundry.toml @@ -88,4 +88,15 @@ cache_path = "cache-foundry-tron" out = "out-tron" skip = ["sp1-helios"] +# Tron-compatible profile for Universal SpokePool and SP1Helios. +# Run with `FOUNDRY_PROFILE=tron-universal forge build` +[profile.tron-universal] +solc = "bin/solc-tron" +evm_version = "cancun" +src = "contracts/tron-universal" +test = "test/evm/foundry/tron" +script = "script/universal/tron" +cache_path = "cache-foundry-tron-universal" +out = "out-tron-universal" + # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/package.json b/package.json index a9ad3155e..80189b8df 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,11 @@ "evm-contract-sizes": "forge build --sizes", "pre-commit-hook": "sh scripts/preCommitHook.sh", "extract-addresses": "./script/utils/extract_foundry_addresses.sh", - "generate-constants-json": "ts-node ./script/utils/GenerateConstantsJson.ts" + "generate-constants-json": "ts-node ./script/utils/GenerateConstantsJson.ts", + "build-tron-universal": "FOUNDRY_PROFILE=tron-universal forge build", + "tron-deploy-sp1-auto-verifier": "ts-node script/universal/tron/tron-deploy-sp1-auto-verifier.ts", + "tron-deploy-sp1-helios": "ts-node script/universal/tron/tron-deploy-sp1-helios.ts", + "tron-deploy-universal-spokepool": "ts-node script/universal/tron/tron-deploy-universal-spokepool.ts" }, "dependencies": { "@across-protocol/constants": "^3.1.100", @@ -69,6 +73,7 @@ "@uma/common": "^2.37.3", "@uma/contracts-node": "^0.4.17", "bs58": "^6.0.0", + "tronweb": "^6.2.0", "yargs": "^17.7.2", "zksync-web3": "^0.14.3" }, @@ -85,6 +90,7 @@ "@types/node": "^24.3.0", "@typescript-eslint/eslint-plugin": "^4.29.1", "@typescript-eslint/parser": "^4.29.1", + "chai": "^4.3.6", "codama": "^1.3.0", "dotenv": "^10.0.0", "eslint": "^7.29.0", @@ -94,17 +100,16 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-promise": "^5.1.0", - "chai": "^4.3.6", "ethereumjs-util": "^7.1.4", "ethers": "5.7.2", "husky": "^4.2.3", + "mocha": "^10.0.0", "multiformats": "9.9.0", "prettier": "^3.8.1", "prettier-plugin-rust": "^0.1.9", "prettier-plugin-solidity": "^2.2.1", "pretty-quick": "^4.2.2", "solhint": "^3.6.2", - "mocha": "^10.0.0", "ts-mocha": "^10.0.0", "ts-node": "^10.1.0", "typescript": "^5.6.2" diff --git a/script/universal/tron/README.md b/script/universal/tron/README.md new file mode 100644 index 000000000..461429f82 --- /dev/null +++ b/script/universal/tron/README.md @@ -0,0 +1,149 @@ +# Tron Deployment Scripts + +TypeScript scripts for deploying contracts to Tron via TronWeb. Tron uses a protobuf transaction format (not RLP) and SHA-256 signing (not keccak256), so Foundry's `forge script --broadcast` cannot deploy directly — these scripts handle that. + +## Prerequisites + +### 1. Tron solc binary + +Download Tron's custom solc 0.8.25 from [tronprotocol/solidity releases](https://github.com/tronprotocol/solidity/releases) and place it at `bin/solc-tron`: + +```bash +# macOS (Apple Silicon) +curl -L -o bin/solc-tron https://github.com/nicetip/solidity/releases/download/tv0.8.25/solc_macos +chmod +x bin/solc-tron + +# Linux (amd64) +curl -L -o bin/solc-tron https://github.com/nicetip/solidity/releases/download/tv0.8.25/solc_linux +chmod +x bin/solc-tron +``` + +Verify: + +```bash +bin/solc-tron --version +# solc.tron, the solidity compiler commandline interface +# Version: 0.8.25+commit.77bd169f... +``` + +### 2. Build contracts + +```bash +yarn build-tron-universal +``` + +This runs `FOUNDRY_PROFILE=tron-universal forge build`, which compiles using Tron's solc (`bin/solc-tron`) and outputs Foundry artifacts to `out-tron-universal/`. + +### 3. Environment variables + +Create a `.env` file (or `source .env` before running): + +```bash +# Required for all deployments +MNEMONIC="your twelve word mnemonic phrase here" +NODE_URL_728126428=https://api.trongrid.io # Tron mainnet +NODE_URL_3448148188=https://nile.trongrid.io # Tron Nile testnet + +# Optional +TRON_FEE_LIMIT=1500000000 # Fee limit in sun (default: 1500 TRX) +``` + +> **Important:** Use the base TronGrid URL (`https://api.trongrid.io`), NOT the `/jsonrpc` endpoint. TronWeb needs the native Tron API, not the Ethereum-compatible JSON-RPC endpoint. + +## Deploy Scripts + +### SP1AutoVerifier + +No-op verifier for testing SP1Helios without real ZK proofs. No constructor args. + +```bash +yarn tron-deploy-sp1-auto-verifier + +# Example: deploy to Nile testnet +yarn tron-deploy-sp1-auto-verifier 3448148188 +``` + +### SP1Helios + +Ethereum beacon chain light client. Downloads a genesis binary to generate initial state, then deploys. + +Additional env vars: + +```bash +SP1_RELEASE_TRON=0.1.0-alpha.20 # Genesis binary version +SP1_PROVER_MODE_TRON=network # "mock", "cpu", "cuda", or "network" +SP1_VERIFIER_ADDRESS_TRON=T... # SP1 verifier gateway (Base58Check) +SP1_STATE_UPDATERS_TRON=T...,T... # Comma-separated updater addresses +SP1_VKEY_UPDATER_TRON=T... # VKey updater address +SP1_CONSENSUS_RPCS_LIST_TRON=https://... # Comma-separated beacon chain RPC URLs +``` + +```bash +yarn tron-deploy-sp1-helios +``` + +> **Warning:** Once SP1Helios is deployed, you have 7 days to deploy the Universal_SpokePool and activate it in-protocol. After 7 days with no update, the contract becomes immutable. + +### Universal_SpokePool + +Deploys the implementation contract (not the proxy). Must be wrapped in a UUPS proxy and initialized separately. + +Additional env vars: + +```bash +USP_ADMIN_UPDATE_BUFFER=86400 # Admin update buffer (seconds), e.g. 24h +USP_HELIOS_ADDRESS=T... # Deployed SP1Helios address +USP_HUB_POOL_STORE_ADDRESS=T... # HubPoolStore address +USP_WRAPPED_NATIVE_TOKEN_ADDRESS=T... # WTRX address +USP_DEPOSIT_QUOTE_TIME_BUFFER=3600 # Deposit quote time buffer (seconds) +USP_FILL_DEADLINE_BUFFER=21600 # Fill deadline buffer (seconds) +USP_L2_USDC_ADDRESS=T... # USDC on Tron +USP_CCTP_TOKEN_MESSENGER_ADDRESS=T... # CCTP TokenMessenger, or zero address +USP_OFT_DST_EID=0 # LayerZero OFT endpoint ID, 0 to disable +USP_OFT_FEE_CAP=0 # OFT fee cap in wei, 0 to disable +``` + +```bash +yarn tron-deploy-universal-spokepool +``` + +## Deployment order + +1. **SP1AutoVerifier** (testnet only) or wait for Succinct to deploy the real Groth16 verifier +2. **SP1Helios** — needs the verifier address +3. **Universal_SpokePool** — needs the SP1Helios address + +## Verifying contracts on TronScan + +TronScan requires a single flattened Solidity file for verification. Use `forge flatten`: + +```bash +# Flatten a contract +forge flatten contracts/sp1-helios/SP1Helios.sol > flattened/SP1Helios.sol +forge flatten contracts/sp1-helios/SP1AutoVerifier.sol > flattened/SP1AutoVerifier.sol +forge flatten contracts/Universal_SpokePool.sol > flattened/Universal_SpokePool.sol +``` + +Then verify on TronScan: + +1. Go to the contract page on [TronScan](https://tronscan.org) (or [Nile TronScan](https://nile.tronscan.org) for testnet) +2. Click **Contract** → **Verify and Publish** +3. Select **Solidity (Single file)** +4. Set compiler version to **0.8.25** (must match Tron's solc) +5. Set EVM version to **cancun** +6. Set optimization to **Yes**, runs **800**, via-ir **enabled** +7. Paste the flattened source +8. If the contract has constructor args, provide the ABI-encoded args (logged during deployment as `Constructor args: 0x...`) + +> **Tip:** The `flattened/` directory is gitignored. Regenerate flattened sources from the current contract code before verifying. + +## Broadcast artifacts + +Each deployment writes a Foundry-compatible broadcast artifact to `broadcast/TronDeploy.s.sol//`. These track deployed addresses and transaction IDs. + +## Chain IDs + +| Network | Chain ID | +| ------------ | ---------- | +| Tron Mainnet | 728126428 | +| Tron Nile | 3448148188 | diff --git a/script/universal/tron/deploy.ts b/script/universal/tron/deploy.ts new file mode 100644 index 000000000..82beeef78 --- /dev/null +++ b/script/universal/tron/deploy.ts @@ -0,0 +1,306 @@ +#!/usr/bin/env ts-node +/** + * Shared TronWeb deployer for Tron contract deployments. + * + * Import from per-contract wrapper scripts: + * import { deployContract } from "./deploy"; + * await deployContract({ chainId, artifactPath, encodedArgs }); + * + * Env vars: + * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) + * NODE_URL_728126428 — Tron mainnet full node URL + * NODE_URL_3448148188 — Tron Nile testnet full node URL + * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + */ + +import "dotenv/config"; +import * as fs from "fs"; +import * as path from "path"; +import { TronWeb } from "tronweb"; + +const POLL_INTERVAL_MS = 3000; +const MAX_POLL_ATTEMPTS = 40; // ~2 minutes + +const TRONSCAN_URLS: Record = { + "728126428": "https://tronscan.org", + "3448148188": "https://nile.tronscan.org", +}; + +export interface DeployResult { + address: string; // Tron Base58 (T...) + txID: string; +} + +/** ABI-encode constructor args. Wrapper around TronWeb's ABI encoder for use by deploy scripts. */ +export function encodeArgs(types: string[], values: any[]): string { + // Lightweight TronWeb instance for ABI encoding only (no network calls). + const tw = new TronWeb({ fullHost: "http://localhost" }); + return tw.utils.abi.encodeParams(types, values); +} + +/** Convert a Tron Base58Check address (T...) to a 0x-prefixed 20-byte EVM hex address. */ +export function tronToEvmAddress(base58: string): string { + const hex = TronWeb.address.toHex(base58); + // TronWeb returns 41-prefixed hex (e.g. "41abc..."). Strip the 41 prefix to get the 20-byte address. + // Guard against alternate formats: if it starts with "0x41", strip 4 chars; if "41", strip 2. + if (hex.startsWith("0x41") && hex.length === 44) return "0x" + hex.slice(4); + if (hex.startsWith("41") && hex.length === 42) return "0x" + hex.slice(2); + throw new Error(`Unexpected TronWeb hex address format: ${hex}`); +} + +/** Decode ABI-encoded constructor args into human-readable strings for the broadcast `arguments` field. */ +function decodeConstructorArgs(tronWeb: TronWeb, abi: any[], parameterHex: string): string[] | null { + const ctor = abi.find((e: any) => e.type === "constructor"); + if (!ctor || !ctor.inputs?.length || !parameterHex) return null; + try { + const types = ctor.inputs.map((i: any) => i.type); + const names = ctor.inputs.map((i: any) => i.name); + const decoded = tronWeb.utils.abi.decodeParams(names, types, "0x" + parameterHex, false); + return ctor.inputs.map((input: any) => { + const val = decoded[input.name]; + // TronWeb returns addresses as 41-prefixed hex; convert to Base58Check (T...) for TronScan. + if (input.type === "address" && typeof val === "string" && val.startsWith("41") && val.length === 42) { + return tronWeb.address.fromHex(val); + } + return val.toString(); + }); + } catch { + return null; + } +} + +/** Write a Foundry-compatible broadcast artifact to broadcast///. */ +function writeBroadcastArtifact(opts: { + tronWeb: TronWeb; + contractName: string; + contractAddress: string; + txID: string; + chainId: string; + deployerAddress: string; + bytecode: string; + parameter: string | undefined; + abi: any[]; + feeLimit: number; + txInfo: any; +}): void { + // Use TronDeploy.s.sol as the directory name for consistency with existing broadcast artifacts. + const scriptName = `TronDeploy${opts.contractName}.s.sol`; + const chainIdNum = parseInt(opts.chainId, 10); + const now = Date.now(); + const txHash = opts.txID; + const initcode = `0x${opts.bytecode}${opts.parameter || ""}`; + const blockNum = opts.txInfo.blockNumber ? "0x" + opts.txInfo.blockNumber.toString(16) : "0x0"; + const energyUsed = opts.txInfo.receipt?.energy_usage_total; + const gasUsed = energyUsed ? "0x" + energyUsed.toString(16) : "0x0"; + + const broadcast = { + transactions: [ + { + hash: txHash, + transactionType: "CREATE", + contractName: opts.contractName, + contractAddress: opts.contractAddress, + function: null, + arguments: decodeConstructorArgs(opts.tronWeb, opts.abi, opts.parameter || ""), + transaction: { + from: opts.deployerAddress, + gas: "0x" + opts.feeLimit.toString(16), + value: "0x0", + input: initcode, + chainId: "0x" + chainIdNum.toString(16), + }, + additionalContracts: [], + }, + ], + receipts: [ + { + status: "0x1", + cumulativeGasUsed: gasUsed, + transactionHash: txHash, + blockHash: null, // TRON doesn't expose blockHash via getTransactionInfo + blockNumber: blockNum, + gasUsed, + from: opts.deployerAddress, + to: null, + contractAddress: opts.contractAddress, + }, + ], + libraries: [], + pending: [], + returns: {}, + timestamp: now, + chain: chainIdNum, + }; + + const broadcastDir = path.resolve(__dirname, "../../../broadcast", scriptName, opts.chainId); + fs.mkdirSync(broadcastDir, { recursive: true }); + + const json = JSON.stringify(broadcast, null, 2) + "\n"; + const runFile = path.join(broadcastDir, `run-${now}.json`); + const latestFile = path.join(broadcastDir, "run-latest.json"); + + fs.writeFileSync(runFile, json); + fs.writeFileSync(latestFile, json); + console.log(` Broadcast: ${runFile}`); +} + +/** + * Deploy a contract to Tron via TronWeb. + * + * @param opts.chainId Tron chain ID (728126428 for mainnet, 3448148188 for Nile testnet) + * @param opts.artifactPath Path to the Foundry-compiled artifact JSON + * @param opts.encodedArgs Optional ABI-encoded constructor args (0x-prefixed hex) + * @returns Deployed contract addresses and transaction ID + */ +export async function deployContract(opts: { + chainId: string; + artifactPath: string; + encodedArgs?: string; +}): Promise { + const { chainId, artifactPath, encodedArgs } = opts; + + const TRON_CHAIN_IDS = ["728126428", "3448148188"]; // mainnet, Nile testnet + if (!TRON_CHAIN_IDS.includes(chainId)) { + console.log(`Error: invalid chain ID "${chainId}". Use 728126428 (Tron mainnet) or 3448148188 (Nile testnet).`); + process.exit(1); + } + + const mnemonic = process.env.MNEMONIC; + const fullNode = process.env[`NODE_URL_${chainId}`]; + if (!mnemonic) { + console.log("Error: MNEMONIC env var is required."); + process.exit(1); + } + if (!fullNode) { + console.log(`Error: NODE_URL_${chainId} env var is required (Tron full node URL).`); + process.exit(1); + } + + const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "1500000000", 10); + + // Create a TronWeb instance (private key set below after mnemonic derivation). + const tronWeb = new TronWeb({ fullHost: fullNode }); + + // Derive account 0 private key from mnemonic (same derivation as Foundry's vm.deriveKey(mnemonic, 0)). + // We use Ethereum's HD path (m/44'/60'/0'/0/0) — NOT Tron's default (m/44'/195'/0'/0/0) — because + // the deployer key must match the one Foundry derives. TronWeb.fromMnemonic() enforces Tron's path, + // so we use the bundled ethers HDNodeWallet directly to derive with the Ethereum path. + const { ethersHDNodeWallet, Mnemonic } = tronWeb.utils.ethersUtils; + const mnemonicObj = Mnemonic.fromPhrase(mnemonic); + const wallet = ethersHDNodeWallet.fromMnemonic(mnemonicObj, "m/44'/60'/0'/0/0"); + const privateKey = wallet.privateKey.slice(2); + tronWeb.setPrivateKey(privateKey); + const deployerAddressRaw = tronWeb.address.fromPrivateKey(privateKey); + if (typeof deployerAddressRaw !== "string") { + console.log("Error: could not derive deployer address from private key."); + process.exit(1); + } + const deployerAddress = deployerAddressRaw; + + // Read the Foundry-compiled artifact to get the ABI and bytecode. + if (!fs.existsSync(artifactPath)) { + console.log(`Error: artifact not found at ${artifactPath}. Run "forge build" first.`); + process.exit(1); + } + const artifact = JSON.parse(fs.readFileSync(artifactPath, "utf-8")); + const abi = artifact.abi; + let bytecode: string = artifact.bytecode?.object || artifact.bytecode; + if (typeof bytecode === "string" && bytecode.startsWith("0x")) { + bytecode = bytecode.slice(2); + } + if (!abi || !bytecode) { + console.log("Error: artifact missing abi or bytecode."); + process.exit(1); + } + + // Extract contract name from artifact filename (e.g. "SP1Helios" from ".../SP1Helios.json"). + const contractName = path.basename(artifactPath, ".json"); + + // Strip 0x prefix from encoded args if provided (TronWeb expects raw hex). + let parameter: string | undefined; + if (encodedArgs) { + parameter = encodedArgs.startsWith("0x") ? encodedArgs.slice(2) : encodedArgs; + } + + console.log(`Deploying ${contractName} to ${fullNode}...`); + if (parameter) console.log(` Constructor args: 0x${parameter}`); + console.log(` Fee limit: ${feeLimit} sun (${feeLimit / 1e6} TRX)`); + + // Build the CreateSmartContract transaction via TronWeb. + const txOptions = { + abi, + bytecode, + name: contractName, + feeLimit, + ...(parameter ? { parameters: [] as unknown[], rawParameter: parameter } : {}), + }; + + const tx = await tronWeb.transactionBuilder.createSmartContract(txOptions); + + // Sign the transaction (SHA-256 + secp256k1, not keccak256 like Ethereum). + const signedTx = await tronWeb.trx.sign(tx); + + // Broadcast the signed transaction to the Tron network. + const result = await tronWeb.trx.sendRawTransaction(signedTx); + + if (!result.result) { + console.log("Error: transaction rejected:", JSON.stringify(result, null, 2)); + process.exit(1); + } + + const txID: string = result.transaction?.txID; + console.log(`Transaction sent: ${txID}`); + + // Poll for confirmation — Tron doesn't return receipts synchronously. + let txInfo: any; + for (let i = 0; i < MAX_POLL_ATTEMPTS; i++) { + await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS)); + txInfo = await tronWeb.trx.getTransactionInfo(txID); + if (txInfo && txInfo.id) break; + console.log(`Waiting for confirmation... (${i + 1}/${MAX_POLL_ATTEMPTS})`); + } + + if (!txInfo || !txInfo.id) { + console.log("Error: transaction not confirmed within timeout."); + process.exit(1); + } + + if (txInfo.receipt?.result !== "SUCCESS") { + console.log("Error: transaction failed:", JSON.stringify(txInfo, null, 2)); + process.exit(1); + } + + // Extract contract address from transaction info (Tron returns hex with 41 prefix). + const tronHexAddress: string = txInfo.contract_address; + if (!tronHexAddress) { + console.log("Error: no contract_address in transaction info."); + process.exit(1); + } + + const contractAddress = tronWeb.address.fromHex(tronHexAddress); + const tronscanBase = TRONSCAN_URLS[chainId] || "https://tronscan.org"; + + console.log(`\nContract deployed!`); + console.log(` Address: ${contractAddress}`); + console.log(` TX ID: ${txID}`); + console.log(` Tronscan: ${tronscanBase}/#/contract/${contractAddress}`); + + writeBroadcastArtifact({ + tronWeb, + contractName, + contractAddress, + txID, + chainId, + deployerAddress, + bytecode, + parameter, + abi, + feeLimit, + txInfo, + }); + + return { + address: contractAddress, + txID, + }; +} diff --git a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts b/script/universal/tron/tron-deploy-sp1-auto-verifier.ts new file mode 100644 index 000000000..ce918c96c --- /dev/null +++ b/script/universal/tron/tron-deploy-sp1-auto-verifier.ts @@ -0,0 +1,38 @@ +#!/usr/bin/env ts-node +/** + * Deploys SP1AutoVerifier to Tron via TronWeb. + * + * SP1AutoVerifier has no constructor args — it's a no-op verifier for testing. + * + * Env vars: + * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) + * NODE_URL_728126428 — Tron mainnet full node URL + * NODE_URL_3448148188 — Tron Nile testnet full node URL + * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * + * Usage: + * yarn tron-deploy-sp1-auto-verifier + */ + +import * as path from "path"; +import { deployContract } from "./deploy"; + +async function main(): Promise { + const chainId = process.argv[2]; + if (!chainId) { + console.log("Usage: yarn tron-deploy-sp1-auto-verifier "); + process.exit(1); + } + + console.log("=== SP1AutoVerifier Tron Deployment ==="); + console.log(`Chain ID: ${chainId}`); + + const artifactPath = path.resolve(__dirname, "../../../out-tron-universal/SP1AutoVerifier.sol/SP1AutoVerifier.json"); + + await deployContract({ chainId, artifactPath }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/universal/tron/tron-deploy-sp1-helios.ts b/script/universal/tron/tron-deploy-sp1-helios.ts new file mode 100644 index 000000000..35e421d52 --- /dev/null +++ b/script/universal/tron/tron-deploy-sp1-helios.ts @@ -0,0 +1,236 @@ +#!/usr/bin/env ts-node +/** + * Deploys SP1Helios to Tron via TronWeb. + * + * Steps: + * 1. Download the genesis binary from GitHub releases (platform-aware) + * 2. Verify the binary's SHA-256 checksum against checksums.json + * 3. Run the genesis binary to generate/update genesis.json + * 4. Read genesis.json and ABI-encode the SP1Helios constructor args + * 5. Deploy SP1Helios to Tron + * + * Env vars: + * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) + * NODE_URL_728126428 — Tron mainnet full node URL + * NODE_URL_3448148188 — Tron Nile testnet full node URL + * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * SP1_RELEASE_TRON — Genesis binary version (e.g. "0.1.0-alpha.20") + * SP1_PROVER_MODE_TRON — SP1 prover type: "mock", "cpu", "cuda", or "network" + * SP1_VERIFIER_ADDRESS_TRON — SP1 verifier contract address (Tron Base58Check, T...) + * SP1_STATE_UPDATERS_TRON — Comma-separated list of state updater addresses (Tron Base58Check) + * SP1_VKEY_UPDATER_TRON — VKey updater address (Tron Base58Check, T...) + * SP1_CONSENSUS_RPCS_LIST_TRON — Comma-separated list of consensus RPC URLs + * + * Usage: + * yarn tron-deploy-sp1-helios + */ + +import "dotenv/config"; +import * as fs from "fs"; +import * as path from "path"; +import * as os from "os"; +import { execSync } from "child_process"; +import { createHash } from "crypto"; +import { deployContract, encodeArgs, tronToEvmAddress } from "./deploy"; +import { TronWeb as TronWebImport } from "tronweb"; + +const GITHUB_RELEASE_URL = "https://github.com/across-protocol/sp1-helios/releases"; +const SCRIPT_DIR = path.resolve(__dirname); + +function requireEnv(name: string): string { + const value = process.env[name]; + if (!value) { + console.log(`Error: ${name} env var is required.`); + process.exit(1); + } + return value; +} + +/** Detect platform and return the binary suffix. */ +function detectPlatform(): string { + const platform = os.platform(); + if (platform === "darwin") { + console.log("Detected platform: macOS (arm64_darwin)"); + return "arm64_darwin"; + } else { + console.log("Detected platform: Linux (amd64_linux)"); + return "amd64_linux"; + } +} + +/** Download the genesis binary from GitHub releases. */ +function downloadGenesisBinary(version: string): string { + const platformSuffix = detectPlatform(); + const binaryName = `genesis_${version}_${platformSuffix}`; + const downloadUrl = `${GITHUB_RELEASE_URL}/download/v${version}/${binaryName}`; + const binaryPath = path.join(SCRIPT_DIR, "genesis-binary"); + + console.log(`Binary name: ${binaryName}`); + console.log(`Download URL: ${downloadUrl}`); + console.log("Downloading genesis binary..."); + + execSync(`curl -L -o "${binaryPath}" --fail "${downloadUrl}"`, { stdio: "inherit" }); + console.log("Download complete"); + + verifyBinaryChecksum(binaryName, binaryPath); + fs.chmodSync(binaryPath, 0o755); + + return binaryPath; +} + +/** Verify the downloaded binary's SHA-256 checksum against checksums.json. */ +function verifyBinaryChecksum(binaryName: string, binaryPath: string): void { + console.log("Verifying binary checksum..."); + + const checksumsPath = path.resolve(SCRIPT_DIR, "../checksums.json"); + const checksums: Record = JSON.parse(fs.readFileSync(checksumsPath, "utf-8")); + + const expectedChecksum = checksums[binaryName]; + if (!expectedChecksum) { + console.log(`Error: no checksum found for binary: ${binaryName}`); + console.log("Please add the checksum to script/universal/checksums.json"); + process.exit(1); + } + console.log(`Expected checksum: ${expectedChecksum}`); + + const fileBuffer = fs.readFileSync(binaryPath); + const actualChecksum = createHash("sha256").update(fileBuffer).digest("hex"); + console.log(`Actual checksum: ${actualChecksum}`); + + if (expectedChecksum !== actualChecksum) { + console.log("Error: checksum mismatch! Possible tampering detected."); + process.exit(1); + } + console.log("Checksum verified successfully"); +} + +/** Run the genesis binary to generate/update genesis.json. */ +function runGenesisBinary(binaryPath: string, sp1Prover: string, privateKeyHex: string): void { + const sp1VerifierAddress = requireEnv("SP1_VERIFIER_ADDRESS_TRON"); + const stateUpdaters = requireEnv("SP1_STATE_UPDATERS_TRON"); + const vkeyUpdater = requireEnv("SP1_VKEY_UPDATER_TRON"); + const consensusRpcsList = requireEnv("SP1_CONSENSUS_RPCS_LIST_TRON"); + + console.log(`SP1_VERIFIER_ADDRESS: ${sp1VerifierAddress}`); + console.log(`STATE_UPDATERS: ${stateUpdaters}`); + console.log(`VKEY_UPDATER: ${vkeyUpdater}`); + console.log(`CONSENSUS_RPCS_LIST: ${consensusRpcsList}`); + + // The genesis binary expects EVM-format (0x) addresses. Convert Tron Base58Check addresses. + const verifierEvm = tronToEvmAddress(sp1VerifierAddress); + const vkeyUpdaterEvm = tronToEvmAddress(vkeyUpdater); + const updatersEvm = stateUpdaters + .split(",") + .map((a) => tronToEvmAddress(a.trim())) + .join(","); + + console.log("Running genesis binary..."); + execSync(`"${binaryPath}" --out "${SCRIPT_DIR}"`, { + stdio: "inherit", + env: { + ...process.env, + SOURCE_CHAIN_ID: "1", + SP1_PROVER: sp1Prover, + PRIVATE_KEY: privateKeyHex, + SP1_VERIFIER_ADDRESS: verifierEvm, + UPDATERS: updatersEvm, + VKEY_UPDATER: vkeyUpdaterEvm, + CONSENSUS_RPCS_LIST: consensusRpcsList, + }, + }); + console.log("Genesis config updated successfully"); +} + +/** Read genesis.json and return ABI-encoded constructor args for SP1Helios. */ +function readGenesisAndEncode(): string { + const genesisPath = path.join(SCRIPT_DIR, "genesis.json"); + if (!fs.existsSync(genesisPath)) { + console.log(`Error: genesis.json not found at ${genesisPath}`); + process.exit(1); + } + + const genesis = JSON.parse(fs.readFileSync(genesisPath, "utf-8")); + console.log("\n=== Genesis Config ==="); + console.log(` executionStateRoot: ${genesis.executionStateRoot}`); + console.log(` genesisTime: ${genesis.genesisTime}`); + console.log(` head: ${genesis.head}`); + console.log(` header: ${genesis.header}`); + console.log(` heliosProgramVkey: ${genesis.heliosProgramVkey}`); + console.log(` secondsPerSlot: ${genesis.secondsPerSlot}`); + console.log(` slotsPerEpoch: ${genesis.slotsPerEpoch}`); + console.log(` slotsPerPeriod: ${genesis.slotsPerPeriod}`); + console.log(` syncCommitteeHash: ${genesis.syncCommitteeHash}`); + console.log(` verifier: ${genesis.verifier}`); + console.log(` vkeyUpdater: ${genesis.vkeyUpdater}`); + console.log(` updaters: ${JSON.stringify(genesis.updaters)}`); + + // The SP1Helios constructor takes a single InitParams struct as a tuple. + return encodeArgs( + ["(bytes32,uint256,uint256,bytes32,bytes32,uint256,uint256,uint256,bytes32,address,address,address[])"], + [ + [ + genesis.executionStateRoot, + genesis.genesisTime, + genesis.head, + genesis.header, + genesis.heliosProgramVkey, + genesis.secondsPerSlot, + genesis.slotsPerEpoch, + genesis.slotsPerPeriod, + genesis.syncCommitteeHash, + genesis.verifier, + genesis.vkeyUpdater, + genesis.updaters, + ], + ] + ); +} + +async function main(): Promise { + const chainId = process.argv[2]; + if (!chainId) { + console.log("Usage: yarn tron-deploy-sp1-helios "); + process.exit(1); + } + + const version = requireEnv("SP1_RELEASE_TRON"); + const sp1Prover = requireEnv("SP1_PROVER_MODE_TRON"); + const mnemonic = requireEnv("MNEMONIC"); + + console.log("=== SP1Helios Tron Deployment ==="); + console.log(`Version: ${version}`); + console.log(`SP1 Prover: ${sp1Prover}`); + console.log(`Chain ID: ${chainId}`); + + // Derive private key (Ethereum HD path to match Foundry) for the genesis binary. + const tw = new TronWebImport({ fullHost: "http://localhost" }); + const { ethersHDNodeWallet, Mnemonic } = tw.utils.ethersUtils; + const mnemonicObj = Mnemonic.fromPhrase(mnemonic); + const wallet = ethersHDNodeWallet.fromMnemonic(mnemonicObj, "m/44'/60'/0'/0/0"); + const privateKeyHex = wallet.privateKey; // 0x-prefixed + + // Step 1-2: Download and verify genesis binary + const binaryPath = downloadGenesisBinary(version); + + // Step 3: Run genesis binary to generate genesis.json + runGenesisBinary(binaryPath, sp1Prover, privateKeyHex); + + // Step 4: Read genesis.json and encode constructor args + const encodedArgs = readGenesisAndEncode(); + + // Step 5: Deploy SP1Helios + console.log("\n=== WARNING ==="); + console.log("Once SP1Helios is deployed, you have 7 days to deploy the UniversalSpokePool"); + console.log("and activate it in-protocol. After 7 days with no update, the contract becomes"); + console.log("immutable and cannot be updated."); + console.log("================\n"); + + const artifactPath = path.resolve(__dirname, "../../../out-tron-universal/SP1Helios.sol/SP1Helios.json"); + + await deployContract({ chainId, artifactPath, encodedArgs }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts new file mode 100644 index 000000000..36421fd54 --- /dev/null +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -0,0 +1,101 @@ +#!/usr/bin/env ts-node +/** + * Deploys Universal_SpokePool to Tron via TronWeb. + * + * This deploys the implementation contract only — it must be wrapped in a UUPS proxy + * and initialized separately. + * + * Env vars: + * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) + * NODE_URL_728126428 — Tron mainnet full node URL + * NODE_URL_3448148188 — Tron Nile testnet full node URL + * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * USP_ADMIN_UPDATE_BUFFER — Admin update buffer in seconds (e.g. 86400 = 24h) + * USP_HELIOS_ADDRESS — SP1Helios contract address (Tron Base58Check, T...) + * USP_HUB_POOL_STORE_ADDRESS — HubPoolStore contract address (Tron Base58Check, T...) + * USP_WRAPPED_NATIVE_TOKEN_ADDRESS — Wrapped native token (WTRX) address (Tron Base58Check, T...) + * USP_DEPOSIT_QUOTE_TIME_BUFFER — Deposit quote time buffer in seconds + * USP_FILL_DEADLINE_BUFFER — Fill deadline buffer in seconds + * USP_L2_USDC_ADDRESS — USDC token address on Tron (Tron Base58Check, T...) + * USP_CCTP_TOKEN_MESSENGER_ADDRESS — CCTP TokenMessenger address (Tron Base58Check, T...), or zero address to disable + * USP_OFT_DST_EID — LayerZero OFT destination endpoint ID (0 to disable) + * USP_OFT_FEE_CAP — LayerZero OFT fee cap in wei (0 to disable) + * + * Usage: + * yarn tron-deploy-universal-spokepool + */ + +import "dotenv/config"; +import * as path from "path"; +import { deployContract, encodeArgs, tronToEvmAddress } from "./deploy"; + +function requireEnv(name: string): string { + const value = process.env[name]; + if (!value) { + console.log(`Error: ${name} env var is required.`); + process.exit(1); + } + return value; +} + +async function main(): Promise { + const chainId = process.argv[2]; + if (!chainId) { + console.log("Usage: yarn tron-deploy-universal-spokepool "); + process.exit(1); + } + + console.log("=== Universal_SpokePool Tron Deployment ==="); + console.log(`Chain ID: ${chainId}`); + + const adminUpdateBuffer = requireEnv("USP_ADMIN_UPDATE_BUFFER"); + const heliosAddress = tronToEvmAddress(requireEnv("USP_HELIOS_ADDRESS")); + const hubPoolStoreAddress = tronToEvmAddress(requireEnv("USP_HUB_POOL_STORE_ADDRESS")); + const wrappedNativeToken = tronToEvmAddress(requireEnv("USP_WRAPPED_NATIVE_TOKEN_ADDRESS")); + const depositQuoteTimeBuffer = requireEnv("USP_DEPOSIT_QUOTE_TIME_BUFFER"); + const fillDeadlineBuffer = requireEnv("USP_FILL_DEADLINE_BUFFER"); + const l2Usdc = tronToEvmAddress(requireEnv("USP_L2_USDC_ADDRESS")); + const cctpTokenMessenger = tronToEvmAddress(requireEnv("USP_CCTP_TOKEN_MESSENGER_ADDRESS")); + const oftDstEid = requireEnv("USP_OFT_DST_EID"); + const oftFeeCap = requireEnv("USP_OFT_FEE_CAP"); + + console.log(` Admin update buffer: ${adminUpdateBuffer}s`); + console.log(` Helios: ${heliosAddress}`); + console.log(` HubPoolStore: ${hubPoolStoreAddress}`); + console.log(` Wrapped native token: ${wrappedNativeToken}`); + console.log(` Deposit quote buffer: ${depositQuoteTimeBuffer}s`); + console.log(` Fill deadline buffer: ${fillDeadlineBuffer}s`); + console.log(` L2 USDC: ${l2Usdc}`); + console.log(` CCTP TokenMessenger: ${cctpTokenMessenger}`); + console.log(` OFT dst EID: ${oftDstEid}`); + console.log(` OFT fee cap: ${oftFeeCap}`); + + // Constructor: (uint256, address, address, address, uint32, uint32, IERC20, ITokenMessenger, uint32, uint256) + const encodedArgs = encodeArgs( + ["uint256", "address", "address", "address", "uint32", "uint32", "address", "address", "uint32", "uint256"], + [ + adminUpdateBuffer, + heliosAddress, + hubPoolStoreAddress, + wrappedNativeToken, + depositQuoteTimeBuffer, + fillDeadlineBuffer, + l2Usdc, + cctpTokenMessenger, + oftDstEid, + oftFeeCap, + ] + ); + + const artifactPath = path.resolve( + __dirname, + "../../../out-tron-universal/Universal_SpokePool.sol/Universal_SpokePool.json" + ); + + await deployContract({ chainId, artifactPath, encodedArgs }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/yarn.lock b/yarn.lock index 34151a4c5..3fe59c076 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,6 +16,11 @@ "@openzeppelin/contracts" "4.1.0" "@uma/core" "^2.18.0" +"@adraffy/ens-normalize@1.10.1": + version "1.10.1" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" + integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== + "@adraffy/ens-normalize@^1.11.0": version "1.11.1" resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz#6c2d657d4b2dfb37f8ea811dcb3e60843d4ac24a" @@ -188,6 +193,13 @@ dependencies: regenerator-runtime "^0.13.11" +"@babel/runtime@7.26.10": + version "7.26.10" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.10.tgz#a07b4d8fa27af131a633d7b3524db803eb4764c2" + integrity sha512-2WJMeRQPHKSPemqk/awGrAiuFfzBmOIPXKizAsVhWH9YJqLZ0H+HS4c8loHGgW6utJ3E/ejXQUsiGaQy2NZ9Fw== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/runtime@^7.25.0": version "7.27.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.0.tgz#fbee7cf97c709518ecc1f590984481d5460d4762" @@ -1510,6 +1522,20 @@ resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-1.3.0.tgz#f64b8ff886c240e644e5573c097f86e5b43676dc" integrity sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw== +"@noble/curves@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/curves@1.4.2", "@noble/curves@~1.4.0": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" + integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/curves@1.9.1": version "1.9.1" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.9.1.tgz#9654a0bc6c13420ae252ddcf975eaf0f58f0a35c" @@ -1531,6 +1557,16 @@ dependencies: "@noble/hashes" "1.8.0" +"@noble/hashes@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + +"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@noble/hashes@1.8.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0", "@noble/hashes@^1.8.0", "@noble/hashes@~1.8.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" @@ -1757,11 +1793,25 @@ resolved "https://registry.yarnpkg.com/@scroll-tech/contracts/-/contracts-0.1.0.tgz#ccea8db1b3df7d740e4b7843ac01b5bd25b4438b" integrity sha512-aBbDOc3WB/WveZdpJYcrfvMYMz7ZTEiW8M9XMJLba8p9FAR5KGYB/cV+8+EUsq3MKt7C1BfR+WnXoTVdvwIY6w== +"@scure/base@~1.1.6": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" + integrity sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg== + "@scure/base@~1.2.5": version "1.2.6" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.6.tgz#ca917184b8231394dd8847509c67a0be522e59f6" integrity sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg== +"@scure/bip32@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.4.0.tgz#4e1f1e196abedcef395b33b9674a042524e20d67" + integrity sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg== + dependencies: + "@noble/curves" "~1.4.0" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@scure/bip32@1.7.0", "@scure/bip32@^1.7.0": version "1.7.0" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.7.0.tgz#b8683bab172369f988f1589640e53c4606984219" @@ -1771,6 +1821,14 @@ "@noble/hashes" "~1.8.0" "@scure/base" "~1.2.5" +"@scure/bip39@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.3.0.tgz#0f258c16823ddd00739461ac31398b4e7d6a18c3" + integrity sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ== + dependencies: + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@scure/bip39@1.6.0", "@scure/bip39@^1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.6.0.tgz#475970ace440d7be87a6086cbee77cb8f1a684f9" @@ -2873,6 +2931,13 @@ dependencies: undici-types "~6.21.0" +"@types/node@22.7.5": + version "22.7.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5.tgz#cfde981727a7ab3611a481510b473ae54442b92b" + integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ== + dependencies: + undici-types "~6.19.2" + "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "17.0.21" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" @@ -3320,6 +3385,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== +aes-js@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== + aes-js@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" @@ -3633,6 +3703,15 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@1.13.5: + version "1.13.5" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.5.tgz#5e464688fa127e11a660a2c49441c009f6567a43" + integrity sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q== + dependencies: + follow-redirects "^1.15.11" + form-data "^4.0.5" + proxy-from-env "^1.1.0" + axios@^0.21.1: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" @@ -3753,6 +3832,11 @@ bignumber.js@7.2.1, bignumber.js@^7.2.1: resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== +bignumber.js@9.1.2: + version "9.1.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== + bignumber.js@^8.0.1: version "8.1.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-8.1.1.tgz#4b072ae5aea9c20f6730e4e5d529df1271c4d885" @@ -5527,6 +5611,16 @@ es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: dependencies: es-errors "^1.3.0" +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -6000,6 +6094,16 @@ ethereum-common@^0.0.18: resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= +ethereum-cryptography@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" + integrity sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg== + dependencies: + "@noble/curves" "1.4.2" + "@noble/hashes" "1.4.0" + "@scure/bip32" "1.4.0" + "@scure/bip39" "1.3.0" + ethereum-cryptography@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" @@ -6213,6 +6317,19 @@ ethers@5.7.2, ethers@^5.4.2, ethers@^5.7.1: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethers@6.13.5: + version "6.13.5" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.5.tgz#8c1d6ac988ac08abc3c1d8fabbd4b8b602851ac4" + integrity sha512-+knKNieu5EKRThQJWwqaJ10a6HE9sSehGeqWN65//wE7j47ZpFhKAnHB/JJFibwwg61I/koxaPsXbXpD/skNOQ== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "22.7.5" + aes-js "4.0.0-beta.5" + tslib "2.7.0" + ws "8.17.1" + ethers@^4.0.32, ethers@^4.0.40: version "4.0.49" resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" @@ -6602,6 +6719,11 @@ follow-redirects@^1.14.0, follow-redirects@^1.15.6: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== +follow-redirects@^1.15.11: + version "1.15.11" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" + integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== + for-each@^0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.5.tgz#d650688027826920feeb0af747ee7b9421a41d47" @@ -6651,6 +6773,17 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" + integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -6832,7 +6965,7 @@ get-intrinsic@^1.2.4: has-symbols "^1.0.3" hasown "^2.0.0" -get-intrinsic@^1.3.0: +get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -7098,6 +7231,11 @@ google-p12-pem@^4.0.0: dependencies: node-forge "^1.3.1" +google-protobuf@3.21.4: + version "3.21.4" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.4.tgz#2f933e8b6e5e9f8edde66b7be0024b68f77da6c9" + integrity sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ== + gopd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" @@ -11107,6 +11245,11 @@ semver@7.5.2: dependencies: lru-cache "^6.0.0" +semver@7.7.1: + version "7.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" + integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== + semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -11989,6 +12132,21 @@ triple-beam@^1.3.0: resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== +tronweb@^6.2.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/tronweb/-/tronweb-6.2.2.tgz#84e3e89b903d76b5becfdbd0c451f7169abaf1c1" + integrity sha512-jRBf4+7fJ0HUVzveBi0tE21r3EygCNtbYE92T38Sxlwr/x320W2vz+dvGLOIpp4kW/CvJ4HLvtnb6U30A0V2eA== + dependencies: + "@babel/runtime" "7.26.10" + axios "1.13.5" + bignumber.js "9.1.2" + ethereum-cryptography "2.2.1" + ethers "6.13.5" + eventemitter3 "5.0.1" + google-protobuf "3.21.4" + semver "7.7.1" + validator "13.15.23" + truffle-deploy-registry@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/truffle-deploy-registry/-/truffle-deploy-registry-0.5.1.tgz#1d9ea967c3b16cdacaf5c310b124e24e4c641d8a" @@ -12061,6 +12219,11 @@ tsconfig-paths@^3.5.0: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" + integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== + tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -12250,6 +12413,11 @@ undici-types@^7.18.2: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.18.2.tgz#29357a89e7b7ca4aef3bf0fd3fd0cd73884229e9" integrity sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + undici-types@~6.21.0: version "6.21.0" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" @@ -12436,6 +12604,11 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validator@13.15.23: + version "13.15.23" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.23.tgz#59a874f84e4594588e3409ab1edbe64e96d0c62d" + integrity sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw== + varint@^5.0.0, varint@^5.0.2, varint@~5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" @@ -13593,6 +13766,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.17.1: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== + ws@8.18.3: version "8.18.3" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" From 4965edfd05834ba94321bd7ad4926dde0dc9f237 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Mon, 23 Mar 2026 11:07:59 -0600 Subject: [PATCH 05/19] consolidate to single foundry profile for Tron --- .gitignore | 4 ---- contracts/tron-universal/TronImports.sol | 9 -------- contracts/tron/TronCounterfactualImports.sol | 13 +++++++++++ contracts/tron/TronImports.sol | 8 +++++++ foundry.toml | 22 +++++-------------- package.json | 2 +- script/universal/tron/README.md | 10 +++++---- .../tron/tron-deploy-sp1-auto-verifier.ts | 2 +- .../universal/tron/tron-deploy-sp1-helios.ts | 2 +- .../tron/tron-deploy-universal-spokepool.ts | 5 +---- 10 files changed, 36 insertions(+), 41 deletions(-) delete mode 100644 contracts/tron-universal/TronImports.sol create mode 100644 contracts/tron/TronCounterfactualImports.sol create mode 100644 contracts/tron/TronImports.sol diff --git a/.gitignore b/.gitignore index 6f887f429..c1f3dc3a6 100644 --- a/.gitignore +++ b/.gitignore @@ -30,14 +30,10 @@ artifacts-zk out out-local out-tron -out-tron-universal -out-tron-spokepool zkout cache-foundry cache-foundry-local cache-foundry-tron -cache-foundry-tron-universal -cache-foundry-tron-spokepool # Upgradeability files .openzeppelin diff --git a/contracts/tron-universal/TronImports.sol b/contracts/tron-universal/TronImports.sol deleted file mode 100644 index 4bcaca6f4..000000000 --- a/contracts/tron-universal/TronImports.sol +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity ^0.8.0; - -// Entry point for the tron-universal Foundry profile. Importing these contracts here causes -// them (and their dependencies) to be compiled with Tron's solc (bin/solc-tron) and output -// to out-tron-universal/. -import "../sp1-helios/SP1Helios.sol"; -import "../sp1-helios/SP1AutoVerifier.sol"; -import "../Universal_SpokePool.sol"; diff --git a/contracts/tron/TronCounterfactualImports.sol b/contracts/tron/TronCounterfactualImports.sol new file mode 100644 index 000000000..94b1f276c --- /dev/null +++ b/contracts/tron/TronCounterfactualImports.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +// Entry point for counterfactual contracts in the tron Foundry profile. These use OZ v4 and must +// be in a separate file from SP1Helios/UniversalSpokePool (OZ v5) to avoid name collisions. +import "../periphery/counterfactual/AdminWithdrawManager.sol"; +import "../periphery/counterfactual/CounterfactualConstants.sol"; +import "../periphery/counterfactual/CounterfactualDeposit.sol"; +import "../periphery/counterfactual/CounterfactualDepositCCTP.sol"; +import "../periphery/counterfactual/CounterfactualDepositFactoryTron.sol"; +import "../periphery/counterfactual/CounterfactualDepositOFT.sol"; +import "../periphery/counterfactual/CounterfactualDepositSpokePool.sol"; +import "../periphery/counterfactual/WithdrawImplementation.sol"; diff --git a/contracts/tron/TronImports.sol b/contracts/tron/TronImports.sol new file mode 100644 index 000000000..0a7a3d77b --- /dev/null +++ b/contracts/tron/TronImports.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +// Entry point for SP1Helios and UniversalSpokePool in the tron Foundry profile. These use OZ v5 +// and must be in a separate file from counterfactual contracts (OZ v4) to avoid name collisions. +import "../sp1-helios/SP1Helios.sol"; +import "../sp1-helios/SP1AutoVerifier.sol"; +import "../Universal_SpokePool.sol"; diff --git a/foundry.toml b/foundry.toml index 3597e910f..aac18001a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -75,28 +75,16 @@ revert_strings = "default" cache_path = "cache-foundry-local" out = "out-local" -# Tron-compatible profile. Compiles counterfactual contracts at 0.8.25 (max supported by Tron's solc fork). +# Tron-compatible profile. Uses Tron's solc fork (bin/solc-tron) to compile all Tron-targeted +# contracts: counterfactual, UniversalSpokePool, and SP1Helios. # Run with `FOUNDRY_PROFILE=tron forge build` [profile.tron] -solc_version = "0.8.25" -solc = "0.8.25" -evm_version = "cancun" -src = "contracts/periphery/counterfactual" -test = "test/evm/foundry/tron" -script = "script/counterfactual" -cache_path = "cache-foundry-tron" -out = "out-tron" -skip = ["sp1-helios"] - -# Tron-compatible profile for Universal SpokePool and SP1Helios. -# Run with `FOUNDRY_PROFILE=tron-universal forge build` -[profile.tron-universal] solc = "bin/solc-tron" evm_version = "cancun" -src = "contracts/tron-universal" +src = "contracts/tron" test = "test/evm/foundry/tron" script = "script/universal/tron" -cache_path = "cache-foundry-tron-universal" -out = "out-tron-universal" +cache_path = "cache-foundry-tron" +out = "out-tron" # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/package.json b/package.json index 80189b8df..ee9281748 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "pre-commit-hook": "sh scripts/preCommitHook.sh", "extract-addresses": "./script/utils/extract_foundry_addresses.sh", "generate-constants-json": "ts-node ./script/utils/GenerateConstantsJson.ts", - "build-tron-universal": "FOUNDRY_PROFILE=tron-universal forge build", + "build-tron": "FOUNDRY_PROFILE=tron forge build", "tron-deploy-sp1-auto-verifier": "ts-node script/universal/tron/tron-deploy-sp1-auto-verifier.ts", "tron-deploy-sp1-helios": "ts-node script/universal/tron/tron-deploy-sp1-helios.ts", "tron-deploy-universal-spokepool": "ts-node script/universal/tron/tron-deploy-universal-spokepool.ts" diff --git a/script/universal/tron/README.md b/script/universal/tron/README.md index 461429f82..a777900fe 100644 --- a/script/universal/tron/README.md +++ b/script/universal/tron/README.md @@ -9,12 +9,14 @@ TypeScript scripts for deploying contracts to Tron via TronWeb. Tron uses a prot Download Tron's custom solc 0.8.25 from [tronprotocol/solidity releases](https://github.com/tronprotocol/solidity/releases) and place it at `bin/solc-tron`: ```bash +mkdir -p bin + # macOS (Apple Silicon) -curl -L -o bin/solc-tron https://github.com/nicetip/solidity/releases/download/tv0.8.25/solc_macos +curl -L -o bin/solc-tron https://github.com/tronprotocol/solidity/releases/download/tv_0.8.25/solc-macos chmod +x bin/solc-tron # Linux (amd64) -curl -L -o bin/solc-tron https://github.com/nicetip/solidity/releases/download/tv0.8.25/solc_linux +curl -L -o bin/solc-tron https://github.com/tronprotocol/solidity/releases/download/tv_0.8.25/solc-static-linux chmod +x bin/solc-tron ``` @@ -29,10 +31,10 @@ bin/solc-tron --version ### 2. Build contracts ```bash -yarn build-tron-universal +yarn build-tron ``` -This runs `FOUNDRY_PROFILE=tron-universal forge build`, which compiles using Tron's solc (`bin/solc-tron`) and outputs Foundry artifacts to `out-tron-universal/`. +This runs `FOUNDRY_PROFILE=tron forge build`, which compiles using Tron's solc (`bin/solc-tron`) and outputs Foundry artifacts to `out-tron/`. ### 3. Environment variables diff --git a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts b/script/universal/tron/tron-deploy-sp1-auto-verifier.ts index ce918c96c..ba25eecb6 100644 --- a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts +++ b/script/universal/tron/tron-deploy-sp1-auto-verifier.ts @@ -27,7 +27,7 @@ async function main(): Promise { console.log("=== SP1AutoVerifier Tron Deployment ==="); console.log(`Chain ID: ${chainId}`); - const artifactPath = path.resolve(__dirname, "../../../out-tron-universal/SP1AutoVerifier.sol/SP1AutoVerifier.json"); + const artifactPath = path.resolve(__dirname, "../../../out-tron/SP1AutoVerifier.sol/SP1AutoVerifier.json"); await deployContract({ chainId, artifactPath }); } diff --git a/script/universal/tron/tron-deploy-sp1-helios.ts b/script/universal/tron/tron-deploy-sp1-helios.ts index 35e421d52..aef57c4ab 100644 --- a/script/universal/tron/tron-deploy-sp1-helios.ts +++ b/script/universal/tron/tron-deploy-sp1-helios.ts @@ -225,7 +225,7 @@ async function main(): Promise { console.log("immutable and cannot be updated."); console.log("================\n"); - const artifactPath = path.resolve(__dirname, "../../../out-tron-universal/SP1Helios.sol/SP1Helios.json"); + const artifactPath = path.resolve(__dirname, "../../../out-tron/SP1Helios.sol/SP1Helios.json"); await deployContract({ chainId, artifactPath, encodedArgs }); } diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index 36421fd54..08764f9f0 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -87,10 +87,7 @@ async function main(): Promise { ] ); - const artifactPath = path.resolve( - __dirname, - "../../../out-tron-universal/Universal_SpokePool.sol/Universal_SpokePool.json" - ); + const artifactPath = path.resolve(__dirname, "../../../out-tron/Universal_SpokePool.sol/Universal_SpokePool.json"); await deployContract({ chainId, artifactPath, encodedArgs }); } From c0e1d0232b3cf7c0ba5b8e0045e37aa5a0aedddd Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Mon, 23 Mar 2026 17:26:11 -0600 Subject: [PATCH 06/19] disable CCTP in USP deploy script --- .../universal/tron/tron-deploy-universal-spokepool.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index 08764f9f0..19bd706be 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -16,8 +16,6 @@ * USP_WRAPPED_NATIVE_TOKEN_ADDRESS — Wrapped native token (WTRX) address (Tron Base58Check, T...) * USP_DEPOSIT_QUOTE_TIME_BUFFER — Deposit quote time buffer in seconds * USP_FILL_DEADLINE_BUFFER — Fill deadline buffer in seconds - * USP_L2_USDC_ADDRESS — USDC token address on Tron (Tron Base58Check, T...) - * USP_CCTP_TOKEN_MESSENGER_ADDRESS — CCTP TokenMessenger address (Tron Base58Check, T...), or zero address to disable * USP_OFT_DST_EID — LayerZero OFT destination endpoint ID (0 to disable) * USP_OFT_FEE_CAP — LayerZero OFT fee cap in wei (0 to disable) * @@ -54,8 +52,9 @@ async function main(): Promise { const wrappedNativeToken = tronToEvmAddress(requireEnv("USP_WRAPPED_NATIVE_TOKEN_ADDRESS")); const depositQuoteTimeBuffer = requireEnv("USP_DEPOSIT_QUOTE_TIME_BUFFER"); const fillDeadlineBuffer = requireEnv("USP_FILL_DEADLINE_BUFFER"); - const l2Usdc = tronToEvmAddress(requireEnv("USP_L2_USDC_ADDRESS")); - const cctpTokenMessenger = tronToEvmAddress(requireEnv("USP_CCTP_TOKEN_MESSENGER_ADDRESS")); + // USDC / CCTP is not supported on Tron. + const l2Usdc = "0x0000000000000000000000000000000000000000"; + const cctpTokenMessenger = "0x0000000000000000000000000000000000000000"; const oftDstEid = requireEnv("USP_OFT_DST_EID"); const oftFeeCap = requireEnv("USP_OFT_FEE_CAP"); @@ -65,8 +64,8 @@ async function main(): Promise { console.log(` Wrapped native token: ${wrappedNativeToken}`); console.log(` Deposit quote buffer: ${depositQuoteTimeBuffer}s`); console.log(` Fill deadline buffer: ${fillDeadlineBuffer}s`); - console.log(` L2 USDC: ${l2Usdc}`); - console.log(` CCTP TokenMessenger: ${cctpTokenMessenger}`); + console.log(` L2 USDC: ${l2Usdc} (disabled — CCTP not supported on Tron)`); + console.log(` CCTP TokenMessenger: ${cctpTokenMessenger} (disabled)`); console.log(` OFT dst EID: ${oftDstEid}`); console.log(` OFT fee cap: ${oftFeeCap}`); From a2f4956719529fdfba4337617e0c545de81a8a81 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Mon, 23 Mar 2026 17:32:35 -0600 Subject: [PATCH 07/19] remove OFT args from USP deploy script --- .../universal/tron/tron-deploy-universal-spokepool.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index 19bd706be..e1a603b55 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -16,8 +16,6 @@ * USP_WRAPPED_NATIVE_TOKEN_ADDRESS — Wrapped native token (WTRX) address (Tron Base58Check, T...) * USP_DEPOSIT_QUOTE_TIME_BUFFER — Deposit quote time buffer in seconds * USP_FILL_DEADLINE_BUFFER — Fill deadline buffer in seconds - * USP_OFT_DST_EID — LayerZero OFT destination endpoint ID (0 to disable) - * USP_OFT_FEE_CAP — LayerZero OFT fee cap in wei (0 to disable) * * Usage: * yarn tron-deploy-universal-spokepool @@ -55,8 +53,9 @@ async function main(): Promise { // USDC / CCTP is not supported on Tron. const l2Usdc = "0x0000000000000000000000000000000000000000"; const cctpTokenMessenger = "0x0000000000000000000000000000000000000000"; - const oftDstEid = requireEnv("USP_OFT_DST_EID"); - const oftFeeCap = requireEnv("USP_OFT_FEE_CAP"); + // OFT is not supported on Tron. + const oftDstEid = "0"; + const oftFeeCap = "0"; console.log(` Admin update buffer: ${adminUpdateBuffer}s`); console.log(` Helios: ${heliosAddress}`); @@ -66,8 +65,8 @@ async function main(): Promise { console.log(` Fill deadline buffer: ${fillDeadlineBuffer}s`); console.log(` L2 USDC: ${l2Usdc} (disabled — CCTP not supported on Tron)`); console.log(` CCTP TokenMessenger: ${cctpTokenMessenger} (disabled)`); - console.log(` OFT dst EID: ${oftDstEid}`); - console.log(` OFT fee cap: ${oftFeeCap}`); + console.log(` OFT dst EID: ${oftDstEid} (disabled — OFT not supported on Tron)`); + console.log(` OFT fee cap: ${oftFeeCap} (disabled)`); // Constructor: (uint256, address, address, address, uint32, uint32, IERC20, ITokenMessenger, uint32, uint256) const encodedArgs = encodeArgs( From 7e425d2e8278cc818c5186e64cfe5adaa09b8d7d Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Mon, 23 Mar 2026 17:47:09 -0600 Subject: [PATCH 08/19] lookup hubPoolStore address --- .../tron/tron-deploy-universal-spokepool.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index e1a603b55..ff2756aff 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -12,7 +12,6 @@ * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) * USP_ADMIN_UPDATE_BUFFER — Admin update buffer in seconds (e.g. 86400 = 24h) * USP_HELIOS_ADDRESS — SP1Helios contract address (Tron Base58Check, T...) - * USP_HUB_POOL_STORE_ADDRESS — HubPoolStore contract address (Tron Base58Check, T...) * USP_WRAPPED_NATIVE_TOKEN_ADDRESS — Wrapped native token (WTRX) address (Tron Base58Check, T...) * USP_DEPOSIT_QUOTE_TIME_BUFFER — Deposit quote time buffer in seconds * USP_FILL_DEADLINE_BUFFER — Fill deadline buffer in seconds @@ -22,9 +21,25 @@ */ import "dotenv/config"; +import * as fs from "fs"; import * as path from "path"; import { deployContract, encodeArgs, tronToEvmAddress } from "./deploy"; +const TRON_TESTNET_CHAIN_IDS = ["3448148188"]; + +/** Read the HubPoolStore address from generated/constants.json */ +function getHubPoolStoreAddress(spokeChainId: string): string { + const hubChainId = TRON_TESTNET_CHAIN_IDS.includes(spokeChainId) ? "11155111" : "1"; + const constantsPath = path.resolve(__dirname, "../../../generated/constants.json"); + const constants = JSON.parse(fs.readFileSync(constantsPath, "utf-8")); + const address = constants.L1_ADDRESS_MAP?.[hubChainId]?.hubPoolStore; + if (!address) { + console.log(`Error: hubPoolStore not found in constants.json for hub chain ${hubChainId}`); + process.exit(1); + } + return address; +} + function requireEnv(name: string): string { const value = process.env[name]; if (!value) { @@ -46,7 +61,7 @@ async function main(): Promise { const adminUpdateBuffer = requireEnv("USP_ADMIN_UPDATE_BUFFER"); const heliosAddress = tronToEvmAddress(requireEnv("USP_HELIOS_ADDRESS")); - const hubPoolStoreAddress = tronToEvmAddress(requireEnv("USP_HUB_POOL_STORE_ADDRESS")); + const hubPoolStoreAddress = getHubPoolStoreAddress(chainId); const wrappedNativeToken = tronToEvmAddress(requireEnv("USP_WRAPPED_NATIVE_TOKEN_ADDRESS")); const depositQuoteTimeBuffer = requireEnv("USP_DEPOSIT_QUOTE_TIME_BUFFER"); const fillDeadlineBuffer = requireEnv("USP_FILL_DEADLINE_BUFFER"); From 1ab916d9fecf28bbd6a0e8c6df1037fd6cf7702c Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Tue, 24 Mar 2026 11:06:44 -0600 Subject: [PATCH 09/19] remove unneeded deploy script args --- .../tron/tron-deploy-universal-spokepool.ts | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index ff2756aff..be1d2e49f 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -10,11 +10,7 @@ * NODE_URL_728126428 — Tron mainnet full node URL * NODE_URL_3448148188 — Tron Nile testnet full node URL * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) - * USP_ADMIN_UPDATE_BUFFER — Admin update buffer in seconds (e.g. 86400 = 24h) * USP_HELIOS_ADDRESS — SP1Helios contract address (Tron Base58Check, T...) - * USP_WRAPPED_NATIVE_TOKEN_ADDRESS — Wrapped native token (WTRX) address (Tron Base58Check, T...) - * USP_DEPOSIT_QUOTE_TIME_BUFFER — Deposit quote time buffer in seconds - * USP_FILL_DEADLINE_BUFFER — Fill deadline buffer in seconds * * Usage: * yarn tron-deploy-universal-spokepool @@ -27,11 +23,18 @@ import { deployContract, encodeArgs, tronToEvmAddress } from "./deploy"; const TRON_TESTNET_CHAIN_IDS = ["3448148188"]; -/** Read the HubPoolStore address from generated/constants.json */ -function getHubPoolStoreAddress(spokeChainId: string): string { - const hubChainId = TRON_TESTNET_CHAIN_IDS.includes(spokeChainId) ? "11155111" : "1"; +// WTRX (Wrapped TRX) contract address +const WTRX_ADDRESS = "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"; + +/** Read and cache generated/constants.json. */ +function readConstants(): any { const constantsPath = path.resolve(__dirname, "../../../generated/constants.json"); - const constants = JSON.parse(fs.readFileSync(constantsPath, "utf-8")); + return JSON.parse(fs.readFileSync(constantsPath, "utf-8")); +} + +/** Read the HubPoolStore address from generated/constants.json, matching the Solidity deploy script logic. */ +function getHubPoolStoreAddress(constants: any, spokeChainId: string): string { + const hubChainId = TRON_TESTNET_CHAIN_IDS.includes(spokeChainId) ? "11155111" : "1"; const address = constants.L1_ADDRESS_MAP?.[hubChainId]?.hubPoolStore; if (!address) { console.log(`Error: hubPoolStore not found in constants.json for hub chain ${hubChainId}`); @@ -59,12 +62,14 @@ async function main(): Promise { console.log("=== Universal_SpokePool Tron Deployment ==="); console.log(`Chain ID: ${chainId}`); - const adminUpdateBuffer = requireEnv("USP_ADMIN_UPDATE_BUFFER"); + const constants = readConstants(); + + const adminUpdateBuffer = 86400; // 1 day, matching DeployUniversalSpokePool.s.sol const heliosAddress = tronToEvmAddress(requireEnv("USP_HELIOS_ADDRESS")); - const hubPoolStoreAddress = getHubPoolStoreAddress(chainId); - const wrappedNativeToken = tronToEvmAddress(requireEnv("USP_WRAPPED_NATIVE_TOKEN_ADDRESS")); - const depositQuoteTimeBuffer = requireEnv("USP_DEPOSIT_QUOTE_TIME_BUFFER"); - const fillDeadlineBuffer = requireEnv("USP_FILL_DEADLINE_BUFFER"); + const hubPoolStoreAddress = getHubPoolStoreAddress(constants, chainId); + const wrappedNativeToken = tronToEvmAddress(WTRX_ADDRESS); + const depositQuoteTimeBuffer = constants.TIME_CONSTANTS.QUOTE_TIME_BUFFER; + const fillDeadlineBuffer = constants.TIME_CONSTANTS.FILL_DEADLINE_BUFFER; // USDC / CCTP is not supported on Tron. const l2Usdc = "0x0000000000000000000000000000000000000000"; const cctpTokenMessenger = "0x0000000000000000000000000000000000000000"; From ecbe3cf0fe012d640f902fa480b1adab4f9c075e Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Tue, 24 Mar 2026 11:12:21 -0600 Subject: [PATCH 10/19] use testnet flag rather than chainId --- script/universal/tron/deploy.ts | 12 ++++++++-- .../tron/tron-deploy-sp1-auto-verifier.ts | 13 +++++----- .../universal/tron/tron-deploy-sp1-helios.ts | 24 ++++++++++++------- .../tron/tron-deploy-universal-spokepool.ts | 17 ++++++------- 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/script/universal/tron/deploy.ts b/script/universal/tron/deploy.ts index 82beeef78..922e603c4 100644 --- a/script/universal/tron/deploy.ts +++ b/script/universal/tron/deploy.ts @@ -21,11 +21,19 @@ import { TronWeb } from "tronweb"; const POLL_INTERVAL_MS = 3000; const MAX_POLL_ATTEMPTS = 40; // ~2 minutes +export const TRON_MAINNET_CHAIN_ID = "728126428"; +export const TRON_TESTNET_CHAIN_ID = "3448148188"; + const TRONSCAN_URLS: Record = { - "728126428": "https://tronscan.org", - "3448148188": "https://nile.tronscan.org", + [TRON_MAINNET_CHAIN_ID]: "https://tronscan.org", + [TRON_TESTNET_CHAIN_ID]: "https://nile.tronscan.org", }; +/** Resolve chain ID from argv. Returns mainnet by default, testnet if --testnet flag is present. */ +export function resolveChainId(): string { + return process.argv.includes("--testnet") ? TRON_TESTNET_CHAIN_ID : TRON_MAINNET_CHAIN_ID; +} + export interface DeployResult { address: string; // Tron Base58 (T...) txID: string; diff --git a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts b/script/universal/tron/tron-deploy-sp1-auto-verifier.ts index ba25eecb6..615acfc5d 100644 --- a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts +++ b/script/universal/tron/tron-deploy-sp1-auto-verifier.ts @@ -10,19 +10,18 @@ * NODE_URL_3448148188 — Tron Nile testnet full node URL * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * * Usage: - * yarn tron-deploy-sp1-auto-verifier + * yarn tron-deploy-sp1-auto-verifier [--testnet] */ import * as path from "path"; -import { deployContract } from "./deploy"; +import { deployContract, resolveChainId } from "./deploy"; async function main(): Promise { - const chainId = process.argv[2]; - if (!chainId) { - console.log("Usage: yarn tron-deploy-sp1-auto-verifier "); - process.exit(1); - } + const chainId = resolveChainId(); console.log("=== SP1AutoVerifier Tron Deployment ==="); console.log(`Chain ID: ${chainId}`); diff --git a/script/universal/tron/tron-deploy-sp1-helios.ts b/script/universal/tron/tron-deploy-sp1-helios.ts index aef57c4ab..e8d8ce9c9 100644 --- a/script/universal/tron/tron-deploy-sp1-helios.ts +++ b/script/universal/tron/tron-deploy-sp1-helios.ts @@ -21,8 +21,12 @@ * SP1_VKEY_UPDATER_TRON — VKey updater address (Tron Base58Check, T...) * SP1_CONSENSUS_RPCS_LIST_TRON — Comma-separated list of consensus RPC URLs * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * --fee-limit — fee limit in sun (default: 1500000000 = 1500 TRX) + * * Usage: - * yarn tron-deploy-sp1-helios + * yarn tron-deploy-sp1-helios [--testnet] [--fee-limit ] */ import "dotenv/config"; @@ -31,7 +35,7 @@ import * as path from "path"; import * as os from "os"; import { execSync } from "child_process"; import { createHash } from "crypto"; -import { deployContract, encodeArgs, tronToEvmAddress } from "./deploy"; +import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId } from "./deploy"; import { TronWeb as TronWebImport } from "tronweb"; const GITHUB_RELEASE_URL = "https://github.com/across-protocol/sp1-helios/releases"; @@ -186,12 +190,16 @@ function readGenesisAndEncode(): string { ); } +function parseFlag(flag: string): string | undefined { + const idx = process.argv.indexOf(flag); + return idx !== -1 && idx + 1 < process.argv.length ? process.argv[idx + 1] : undefined; +} + async function main(): Promise { - const chainId = process.argv[2]; - if (!chainId) { - console.log("Usage: yarn tron-deploy-sp1-helios "); - process.exit(1); - } + const chainId = resolveChainId(); + + const feeLimitRaw = parseFlag("--fee-limit"); + const feeLimit = feeLimitRaw ? parseInt(feeLimitRaw, 10) : undefined; const version = requireEnv("SP1_RELEASE_TRON"); const sp1Prover = requireEnv("SP1_PROVER_MODE_TRON"); @@ -227,7 +235,7 @@ async function main(): Promise { const artifactPath = path.resolve(__dirname, "../../../out-tron/SP1Helios.sol/SP1Helios.json"); - await deployContract({ chainId, artifactPath, encodedArgs }); + await deployContract({ chainId, artifactPath, encodedArgs, feeLimit }); } main().catch((err) => { diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index be1d2e49f..6da658af6 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -12,16 +12,17 @@ * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) * USP_HELIOS_ADDRESS — SP1Helios contract address (Tron Base58Check, T...) * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * * Usage: - * yarn tron-deploy-universal-spokepool + * yarn tron-deploy-universal-spokepool [--testnet] */ import "dotenv/config"; import * as fs from "fs"; import * as path from "path"; -import { deployContract, encodeArgs, tronToEvmAddress } from "./deploy"; - -const TRON_TESTNET_CHAIN_IDS = ["3448148188"]; +import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId, TRON_TESTNET_CHAIN_ID } from "./deploy"; // WTRX (Wrapped TRX) contract address const WTRX_ADDRESS = "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"; @@ -34,7 +35,7 @@ function readConstants(): any { /** Read the HubPoolStore address from generated/constants.json, matching the Solidity deploy script logic. */ function getHubPoolStoreAddress(constants: any, spokeChainId: string): string { - const hubChainId = TRON_TESTNET_CHAIN_IDS.includes(spokeChainId) ? "11155111" : "1"; + const hubChainId = spokeChainId === TRON_TESTNET_CHAIN_ID ? "11155111" : "1"; const address = constants.L1_ADDRESS_MAP?.[hubChainId]?.hubPoolStore; if (!address) { console.log(`Error: hubPoolStore not found in constants.json for hub chain ${hubChainId}`); @@ -53,11 +54,7 @@ function requireEnv(name: string): string { } async function main(): Promise { - const chainId = process.argv[2]; - if (!chainId) { - console.log("Usage: yarn tron-deploy-universal-spokepool "); - process.exit(1); - } + const chainId = resolveChainId(); console.log("=== Universal_SpokePool Tron Deployment ==="); console.log(`Chain ID: ${chainId}`); From d30f9c40297da5751f132b8d5768377a35a5085f Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Wed, 25 Mar 2026 15:18:48 -0600 Subject: [PATCH 11/19] Tron SP1 & USP deployments --- .../728126428/run-latest.json | 38 ++++++++ .../728126428/run-latest.json | 38 ++++++++ .../728126428/run-latest.json | 41 ++++++++ .../728126428/run-latest.json | 49 ++++++++++ broadcast/deployed-addresses.json | 20 ++++ broadcast/deployed-addresses.md | 8 ++ contracts/tron/TronImports.sol | 1 + foundry.toml | 1 + script/universal/tron/deploy.ts | 10 +- .../tron/tron-deploy-universal-spokepool.ts | 94 +++++++++++++++---- 10 files changed, 278 insertions(+), 22 deletions(-) create mode 100644 broadcast/TronDeploySP1AutoVerifier.s.sol/728126428/run-latest.json create mode 100644 broadcast/TronDeploySP1Helios.s.sol/728126428/run-latest.json create mode 100644 broadcast/TronDeploySpokePool.s.sol/728126428/run-latest.json create mode 100644 broadcast/TronDeployUniversal_SpokePool.s.sol/728126428/run-latest.json diff --git a/broadcast/TronDeploySP1AutoVerifier.s.sol/728126428/run-latest.json b/broadcast/TronDeploySP1AutoVerifier.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..49b70e1b4 --- /dev/null +++ b/broadcast/TronDeploySP1AutoVerifier.s.sol/728126428/run-latest.json @@ -0,0 +1,38 @@ +{ + "transactions": [ + { + "hash": "6bb786350fb65c85df414085b65caa22e5de47d59a241ec4b213aae2b41a9738", + "transactionType": "CREATE", + "contractName": "SP1AutoVerifier", + "contractAddress": "TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84", + "function": null, + "arguments": null, + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x60808060405234601c57d3601c57d2601c5760e390816100218239f35b5f80fdfe608060405260043610156010575f80fd5b5f3560e01c6341493c60146022575f80fd5b34607057d3607057d2607057606036600319011260705767ffffffffffffffff60243581811160705760579036906004016074565b5050604435908111607057606e9036906004016074565b005b5f80fd5b9181601f8401121560705782359167ffffffffffffffff83116070576020838186019501011160705756fea36474726f6e582212204f85e820606274aa796391a13cd7cfa65b4d32f40114856e31ceeeee246ca8026c6578706572696d656e74616cf564736f6c63430008190041", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0xb1da", + "transactionHash": "6bb786350fb65c85df414085b65caa22e5de47d59a241ec4b213aae2b41a9738", + "blockHash": null, + "blockNumber": "0x4d78cc1", + "gasUsed": "0xb1da", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774372630236, + "chain": 728126428 +} diff --git a/broadcast/TronDeploySP1Helios.s.sol/728126428/run-latest.json b/broadcast/TronDeploySP1Helios.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..5451236cc --- /dev/null +++ b/broadcast/TronDeploySP1Helios.s.sol/728126428/run-latest.json @@ -0,0 +1,38 @@ +{ + "transactions": [ + { + "hash": "2a282124875b409051659cb86e82d2e6ae7eaa16df3d1a801b0936a2ffae81e9", + "transactionType": "CREATE", + "contractName": "SP1Helios", + "contractAddress": "TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx", + "function": null, + "arguments": null, + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x6101206040523461039757d361039757d261039757611b7480380380610024816103af565b92833960208282810103126103975781516001600160401b0381116103975782016101809081818486010312610397576040519182016001600160401b0381118382101761039b57604052805182526020810151602083015260408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100938482015185840152610120916100d48382016103d4565b83850152610140916100e78383016103d4565b858401526101608201516001600160401b03811161039757868201601f8285010112156103975782810151926001600160401b03841161039b5761013060208560051b016103af565b9760208986815201930160208560051b8484010101116103975780820160200192915b60208560051b8284010101841061037c5750505050506101608301938452602083015160805260a083015160a05260e08301518060c05260c084015160e05285840151906040850151811561036857045f52600560205260405f20556080830151600755606083015160408401515f52600360205260405f2055825160408401515f52600460205260405f2055604083015160025560018060a01b0392838093820151168652610202336103f1565b610330575b015116806102dc575b505f5b8251908151811015610270578260206001938360051b010151168061023a575b5001610213565b610243816104e8565b1561023357610269905f80516020611b348339815191525f528360205260405f2061056d565b505f610233565b8460405161151691826105de833960805182818161020d01526111ce015260a051828181610e8001526111f0015260c05182818161057f0152818161086d01528181610a3c0152610fda015260e05182818161029701526103920152518181816108b70152610f5f0152f35b6102e58161045d565b15610210575f80516020611b148339815191525f526001602052610329907f171c7a9a079228058aa00fd1ea317d8dc3c2236f8094acea99c6b2d9f11e49b161056d565b505f610210565b5f80526001602052610362337fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4961056d565b50610207565b634e487b7160e01b5f52601260045260245ffd5b602080809461038a876103d4565b8152019401939250610153565b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b6040519190601f01601f191682016001600160401b0381118382101761039b57604052565b516001600160a81b0381168103610397576001600160a01b031690565b6001600160a01b03165f8181525f80516020611b54833981519152602052604090205460ff16610458575f8181525f80516020611b5483398151915260205260408120805460ff191660011790553391905f80516020611af48339815191528180a4600190565b505f90565b6001600160a01b03165f8181527f61b85ce4a75e9e6b33623437d51a383886e2b7b19b6c604c94a09754a5770b8a60205260409020545f80516020611b14833981519152919060ff166104e257815f525f60205260405f20815f5260205260405f20600160ff1982541617905533915f80516020611af48339815191525f80a4600190565b50505f90565b6001600160a01b03165f8181527f023fa4f84b0dc1972fedb46b8f24412ce56e161cbfb83ecfd51310d8f7c2455f60205260409020545f80516020611b34833981519152919060ff166104e257815f525f60205260405f20815f5260205260405f20600160ff1982541617905533915f80516020611af48339815191525f80a4600190565b6001810190825f528160205260405f2054155f146105d65780546801000000000000000081101561039b57600181018083558110156105c2578390825f5260205f20015554915f5260205260405f2055600190565b634e487b7160e01b5f52603260045260245ffd5b5050505f9056fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816301ffc9a71461102e575080630829c59f14610ffd5780632073ee7014610fb9578063248a9ca314610f835780632b7ac3f314610f365780632f2ff15d14610eca5780632f4cddf114610ea3578063304b907114610e5f57806336568abe14610e0c578063397f3dd414610d475780633f37dce21461060257806349b5c56d146105da57806356f90d79146105a65780635dc86c6d1461055c57806367e6a2ff146105385780637623ee29146105045780637640d76b146104d05780638f46f2cb146104a85780638f7dcfa3146104805780639010d07c1461043157806391d14854146103dd578063a217fddf146103b7578063b97dd9e21461036d578063ca15c87314610339578063d0496ef814610305578063d547741f146102ba578063da30e27914610275578063dac9ada414610230578063f2882461146101eb578063f62ad4e9146101a65763f69e83ca14610173575f80fd5b346101a357d36101a357d26101a35760203660031901126101a357602061019b6004356111cc565b604051908152f35b80fd5b50346101a357d36101a357d26101a357806003193601126101a35760206040517f7f496d3b3a5b8d5d66b1301ac9407fb7ebb241c9fb60310446582db629b017098152f35b50346101a357d36101a357d26101a357806003193601126101a35760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346101a357d36101a357d26101a357806003193601126101a35760206040517f07ecc55c8d82c6f82ef86e34d1905e0f2873c085733fa96f8a6e0316b050d1748152f35b50346101a357d36101a357d26101a357806003193601126101a35760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b50346101a357d36101a357d26101a35760403660031901126101a3576103016004356102e46110a5565b90808452836020526102fc600160408620015461122c565b61124d565b5080f35b50346101a357d36101a357d26101a35760203660031901126101a35760406020916004358152600683522054604051908152f35b50346101a357d36101a357d26101a35760203660031901126101a35760406020916004358152600183522054604051908152f35b50346101a357d36101a357d26101a357806003193601126101a357602061019b6002547f000000000000000000000000000000000000000000000000000000000000000090611161565b50346101a357d36101a357d26101a357806003193601126101a357602090604051908152f35b50346101a357d36101a357d26101a35760403660031901126101a3576001600160a01b03604061040b6110a5565b926004358152806020522091165f52602052602060ff60405f2054166040519015158152f35b50346101a357d36101a357d26101a35760403660031901126101a3576001600160a01b0361047060209260043581526001845260406024359120611375565b9190546040519260031b1c168152f35b50346101a357d36101a357d26101a357806003193601126101a3576020600254604051908152f35b50346101a357d36101a357d26101a357806003193601126101a357602060405162093a808152f35b50346101a357d36101a357d26101a35760203660031901126101a35760406020916004358152600583522054604051908152f35b50346101a357d36101a357d26101a35760203660031901126101a35760406020916004358152600483522054604051908152f35b50346101a357d36101a357d26101a357602061019b610556366110d2565b9161117f565b50346101a357d36101a357d26101a35760203660031901126101a357602061019b7f0000000000000000000000000000000000000000000000000000000000000000600435611161565b50346101a357d36101a357d26101a35760203660031901126101a35760406020916004358152600383522054604051908152f35b50346101a357d36101a357d26101a357806003193601126101a357602061019b6002546111cc565b5034610c0a57d3610c0a57d2610c0a576040366003190112610c0a5760043567ffffffffffffffff8111610c0a5761063e903690600401611113565b60249291923567ffffffffffffffff8111610c0a57610661903690600401611113565b335f9081527f023fa4f84b0dc1972fedb46b8f24412ce56e161cbfb83ecfd51310d8f7c2455f6020526040902054909491907f7f496d3b3a5b8d5d66b1301ac9407fb7ebb241c9fb60310446582db629b017099060ff1615610d2957506020818681010312610c0a5780359467ffffffffffffffff8611610c0a5761012095868184018385010312610c0a5760405196870187811067ffffffffffffffff821117610beb57604090815283820180358952602080820135908a01528082013591890191909152606080820135908901526080808201359089015260a0808201359089015260c0808201359089015260e0808201359089015261010001359067ffffffffffffffff8211610c0a57828401601f8383870101011215610c0a5767ffffffffffffffff82828601013511610beb576040519167ffffffffffffffff85830182013560051b603f01601f1916840190811190841117610beb5784820181018035600581901b603f01601f19168501604052808552602080860194928789016060909302010111610c0a57916020828488010101925b86810183018035606002016020018410610ca6575050505061010087015260a0860151606087015181811115610c8e5750805f52600360205260405f20548015610c7557608088015190818103610c58575050610855816111cc565b4203428111610c445762093a8010610c2c57610892907f000000000000000000000000000000000000000000000000000000000000000090611161565b5f52600560205260405f205460e087015190818103610c0e5750506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690600754823b15610c0a576109275f95610915976040519889978896879663020a49e360e51b88526004880152606060248801526064870191611141565b84810360031901604486015291611141565b03915afa8015610bff57610bd0575b50606082015181526003602052604081205480610baa5750602082015160608301518252600360205260408220555b6002546060830151809110610b77575b81526004602052604081205480610b545750815160608301518252600460205260408220555b805b6101008301518051821015610a35579060206001928260051b0101516060850151907f03361b19557345157e33fd9bd8afe6dde69f89c42137a5648c1fe6c3e9f3c16260406109fc818401946001600160a01b0386511685519161117f565b93602084019485519089526006602052828920556001600160a01b0360608a01519451955191511682519182526020820152a30161099d565b8284610a657f00000000000000000000000000000000000000000000000000000000000000006060830151611161565b90818352600560205260408320805415610b21575b506040810151610a88578280f35b60018201809211610b0d578183526005602052604083205460408201518103610ab057508280f35b610af457806040809201518385526005602052828520550151907f783ee45e8820a8249b1456ff4a715f3bd483b1a59bdc7a49bbc316bbd67a4e2f8380a381808280f35b604051630dbcb16560e41b815260048101839052602490fd5b634e487b7160e01b83526011600452602483fd5b60c0820151809155827f783ee45e8820a8249b1456ff4a715f3bd483b1a59bdc7a49bbc316bbd67a4e2f8580a383610a7a565b82511461099b576024606083015160405190639aaa91a760e01b82526004820152fd5b806002556020830151817ffefccbcf6acd2cac524c1cb2d70450cabbec5bc95873e927c121d2d9b7924a028480a3610975565b602083015114610965576024606083015160405190632b1a7b0160e01b82526004820152fd5b905067ffffffffffffffff8111610beb576040525f80610936565b634e487b7160e01b5f52604160045260245ffd5b6040513d5f823e3d90fd5b5f80fd5b604492506040519163f140763d60e01b835260048301526024820152fd5b6024906040519063e857328760e01b82526004820152fd5b634e487b7160e01b5f52601160045260245ffd5b604492506040519162451d1d60e01b835260048301526024820152fd5b604051631b03482560e31b815260048101839052602490fd5b60249060405190632478307160e11b82526004820152fd5b6060848789010312610c0a5760405180606081011067ffffffffffffffff606083011117610beb57606081016040528435815260208501356020820152604085013574ffffffffffffffffffffffffffffffffffffffffff81168103610c0a576020936060926001600160a01b03869316604082015281520194019391506107f9565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b34610c0a57d3610c0a57d2610c0a576020366003190112610c0a57335f9081527f61b85ce4a75e9e6b33623437d51a383886e2b7b19b6c604c94a09754a5770b8a6020526040902054600435907f07ecc55c8d82c6f82ef86e34d1905e0f2873c085733fa96f8a6e0316b050d1749060ff1615610d29575060075481600755818114610df3577f5cf3ae673bf3aa34e98fc9ae63a505eb0759e0731e4d770e5a5950b68d2f7cea5f80a3005b604051631f3374a160e21b815260048101839052602490fd5b34610c0a57d3610c0a57d2610c0a576040366003190112610c0a57610e2f6110a5565b336001600160a01b03821603610e4d57610e4b9060043561124d565b005b60405163334bd91960e11b8152600490fd5b34610c0a57d3610c0a57d2610c0a575f366003190112610c0a5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b34610c0a57d3610c0a57d2610c0a575f366003190112610c0a576020600754604051908152f35b34610c0a57d3610c0a57d2610c0a576040366003190112610c0a57600435610ef06110a5565b815f525f602052610f07600160405f20015461122c565b610f118183611285565b610f1757005b610e4b915f5260016020526001600160a01b0360405f2091169061139e565b34610c0a57d3610c0a57d2610c0a575f366003190112610c0a5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b34610c0a57d3610c0a57d2610c0a576020366003190112610c0a576004355f525f6020526020600160405f200154604051908152f35b34610c0a57d3610c0a57d2610c0a575f366003190112610c0a5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b34610c0a57d3610c0a57d2610c0a57611018610556366110d2565b5f526006602052602060405f2054604051908152f35b34610c0a57d3610c0a57d2610c0a576020366003190112610c0a576004359063ffffffff60e01b8216809203610c0a57602091635a05180f60e01b811490811561107a575b5015158152f35b637965db0b60e01b811491508115611094575b5083611073565b6301ffc9a760e01b1490508361108d565b60243574ffffffffffffffffffffffffffffffffffffffffff81168103610c0a576001600160a01b031690565b6060906003190112610c0a576004359060243574ffffffffffffffffffffffffffffffffffffffffff81168103610c0a576001600160a01b03169060443590565b9181601f84011215610c0a5782359167ffffffffffffffff8311610c0a5760208381860195010111610c0a57565b908060209392818452848401375f828201840152601f01601f1916010190565b811561116b570490565b634e487b7160e01b5f52601260045260245ffd5b9160405191602083019384526bffffffffffffffffffffffff199060601b1660408301526054820152605481526080810181811067ffffffffffffffff821117610beb5760405251902090565b7f0000000000000000000000000000000000000000000000000000000000000000907f000000000000000000000000000000000000000000000000000000000000000090818102918183041490151715610c44578101809111610c445790565b805f525f60205260405f20335f5260205260ff60405f20541615610d295750565b6112578282611302565b918261126257505090565b611281915f5260016020526001600160a01b0360405f2091169061140d565b5090565b90815f525f6020526001600160a01b0360405f20911690815f5260205260ff60405f205416155f146112fc57815f525f60205260405f20815f5260205260405f20600160ff1982541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d5f80a4600190565b50505f90565b90815f525f6020526001600160a01b0360405f20911690815f5260205260ff60405f2054165f146112fc57815f525f60205260405f20815f5260205260405f2060ff19815416905533917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b5f80a4600190565b805482101561138a575f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b6001810190825f528160205260405f2054155f1461140657805468010000000000000000811015610beb576113f36113dd826001879401855584611375565b819391549060031b91821b915f19901b19161790565b905554915f5260205260405f2055600190565b5050505f90565b906001820191815f528260205260405f2054908115155f146114ca575f1991808301818111610c4457825490848201918211610c4457818103611495575b50505080548015611481578201916114638383611375565b909182549160031b1b19169055555f526020525f6040812055600190565b634e487b7160e01b5f52603160045260245ffd5b6114b56114a56113dd9386611375565b90549060031b1c92839286611375565b90555f528460205260405f20555f808061144b565b505050505f9056fea36474726f6e58221220416c08ab37c70003306442d048223b3323d2007bd1bcc7abbd0b954a4fc03ab56c6578706572696d656e74616cf564736f6c634300081900412f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d07ecc55c8d82c6f82ef86e34d1905e0f2873c085733fa96f8a6e0316b050d1747f496d3b3a5b8d5d66b1301ac9407fb7ebb241c9fb60310446582db629b01709ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb50000000000000000000000000000000000000000000000000000000000000020e84afc3fa2b2acf83937a52a1f9fbf1f7f1966b209f2847945d4c126bb324265000000000000000000000000000000000000000000000000000000005fc630570000000000000000000000000000000000000000000000000000000000d52ae00a47628544a1f8208449a791460abec3deaac0f8c91e0a3be1347ed63a2dd56100b909911ddea7496d0d6c86f054077ccdf23ec2a9c14cf6fac24089d01e27a5000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000020000386f8b99782adeadb4d18f910570613e33d230e190750104b949f00d08333dc000000000000000000000000cf4b2aed384bfa95f54d5f83f5a99304d6a773540000000000000000000000009a8f92a830a5cb89a3816e3d267cb7791c16b04d000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000009a8f92a830a5cb89a3816e3d267cb7791c16b04d", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x15d783", + "transactionHash": "2a282124875b409051659cb86e82d2e6ae7eaa16df3d1a801b0936a2ffae81e9", + "blockHash": null, + "blockNumber": "0x4d8076f", + "gasUsed": "0x15d783", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774466887560, + "chain": 728126428 +} diff --git a/broadcast/TronDeploySpokePool.s.sol/728126428/run-latest.json b/broadcast/TronDeploySpokePool.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..804c6502d --- /dev/null +++ b/broadcast/TronDeploySpokePool.s.sol/728126428/run-latest.json @@ -0,0 +1,41 @@ +{ + "transactions": [ + { + "hash": "916d12109b908916a5180dbaf032c577b758615e975ce909cdee696f066f5ac9", + "transactionType": "CREATE", + "contractName": "SpokePool", + "contractAddress": "TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8", + "function": null, + "arguments": [ + "TKBGZJFbCnrCjwuRu16ytoYTEzruCDP5sR", + "0x647c576c0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c186fa914353c44b2e33ebe05f21846f1048beda000000000000000000000000c186fa914353c44b2e33ebe05f21846f1048beda" + ], + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x6040608081526103fc8038038061001581610218565b92833981019082818303126102145780516001600160a81b0381168103610214576020828101516001600160401b039391926001600160a01b031691848211610214570184601f820112156102145780516100776100728261023d565b610218565b918183528483019685838301011161021457815f9286809301895e83010152813b156101ba577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b03191683179055817fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28051158015906101b3575b610110575b855160ef908161030d8239f35b855193606085019081118582101761019f578652602784527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c83850152660819985a5b195960ca1b848701525161018b945f918291845af4903d15610196573d61017c6100728261023d565b9081525f81943d92013e610258565b505f80808080610103565b60609250610258565b634e487b7160e01b5f52604160045260245ffd5b505f6100fe565b855162461bcd60e51b815260048101849052602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761019f57604052565b6001600160401b03811161019f57601f01601f191660200190565b919290156102ba575081511561026c575090565b3b156102755790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156102cd5750805190602001fd5b604460209160405192839162461bcd60e51b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fdfe60806040523615605c575f8073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416368280378136915af43d5f803e156058573d5ff35b3d5ffd5b5f8073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416368280378136915af43d5f803e156058573d5ff3fea36474726f6e5822122089050ab3202ee4b2831538d2394f163e36841a30b30bcfc17dd54233c73190da6c6578706572696d656e74616cf564736f6c6343000819004100000000000000000000000065011784b96324ac37705c97d938b3d8a27bffb400000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064647c576c0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c186fa914353c44b2e33ebe05f21846f1048beda000000000000000000000000c186fa914353c44b2e33ebe05f21846f1048beda00000000000000000000000000000000000000000000000000000000", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x3c8ff", + "transactionHash": "916d12109b908916a5180dbaf032c577b758615e975ce909cdee696f066f5ac9", + "blockHash": null, + "blockNumber": "0x4d80cbc", + "gasUsed": "0x3c8ff", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774470957778, + "chain": 728126428 +} diff --git a/broadcast/TronDeployUniversal_SpokePool.s.sol/728126428/run-latest.json b/broadcast/TronDeployUniversal_SpokePool.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..9c17353ae --- /dev/null +++ b/broadcast/TronDeployUniversal_SpokePool.s.sol/728126428/run-latest.json @@ -0,0 +1,49 @@ +{ + "transactions": [ + { + "hash": "dd6c4a519ebd1ae4cb184450c83ecadaf313104f3e999300d13d20e968939cfb", + "transactionType": "CREATE", + "contractName": "Universal_SpokePool", + "contractAddress": "TKBGZJFbCnrCjwuRu16ytoYTEzruCDP5sR", + "function": null, + "arguments": [ + "86400", + "TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx", + "TCQwdPfXsJamf9tSfLUo1pnaxPLYT34NXZ", + "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR", + "3600", + "21600", + "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb", + "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb", + "0", + "0" + ], + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x61022060408181523461037957d361037957d2610379578190616465803803809161002a828661037d565b8439610140938491810103126103795781519060209061004b8285016103a0565b916100578286016103a0565b91610064606087016103a0565b610070608088016103bd565b9761007d60a089016103bd565b9261008a60c08a016103a0565b9261009760e08b016103a0565b946101009b6100a78d8d016103bd565b6101209c8d01513060805260c09190915260a0526001600160a01b0392831660e0528c528a525f54600881901c60ff166103255760ff808216036102ed575b506101609384526101808581525f8452825163011a412160e61b8882019081526004825291966001600160401b0392828601929190848411838510176102d057855f9493859489525192165afa963d156102e4573d9182116102d057835191610158601f8201601f191683018461037d565b82523d5f8284013e5b876102c5575b87610293575b5050506101a09485526102009788526101e09687526101c09586525197616096998a6103cf8b396080518a818161131d0152818161171501526118b2015260a0518a8181611c310152615c37015260c0518a8181611e2b0152614e5e015260e0518a8181610899015281816149930152818161509a0152818161519e015281816158990152615914015251898181611bbc0152614b7c0152518881816104d3015261493c015251878181611de1015281816156fb01526157a601525186818161082801528181614f5f01526155dc0152518581816124ff01528181614dca01526155ff0152518481816120c4015261569b015251838181610da10152612c91015251828181610dea01528181611a41015261304c015251818181611ab20152612cd60152f35b9091929650808251920151918181106102b5575b5050161515935f808061016d565b5f19910360031b1b165f806102a7565b815181149750610167565b634e487b7160e01b5f52604160045260245ffd5b60609150610161565b60ff90811916175f557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249886835160ff8152a15f6100e6565b825162461bcd60e51b815260048101889052602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b5f80fd5b601f909101601f19168101906001600160401b038211908210176102d057604052565b516001600160a81b0381168103610379576001600160a01b031690565b519063ffffffff821682036103795756fe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c8063079bd2c71461049a5780630cb84d9a146104955780631186ec331461049057806311eac8551461048b57806315348e44146103f057806317fcb39b1461048657806319c1648c146104815780631b3d55591461047c5780631fab657c1461047757806326b105d21461047257806329cb924d1461046d5780632e378115146104685780632e63e59a146104635780633659cfe61461045e578063437b911614610459578063490e49ef14610454578063493a4f841461044f5780634f1ef2861461044a5780635285e0581461044557806352d1902d14610440578063541f4f141461043b5780635743a7b914610436578063577f51f81461043157806357f6dcb81461042c5780636068d6cb1461042757806361a04d3014610422578063647c576c1461041d578063670fa8ac146104185780636bbbcd2e146103f05780636e400983146104135780636fd5c10e1461040e578063715018a614610409578063738b62e51461040457806373fd4836146103ff5780637659f9e0146103fa578063775c0d03146103f5578063793d2be0146103f05780637aef642c146103eb5780637b939232146103e65780637ef413e1146103e157806382e2c43f146103dc5780638a7860ce146103d75780638b15788e146103d25780638da5cb5b146103cd5780639748cf7c146103c857806397943aa9146103c3578063979f2bc2146103be57806399cc2968146103b95780639a8a0592146103b4578063a1244c67146103af578063a18a096e146103aa578063ac9650d8146103a5578063ad5425c6146103a0578063adb5a6a61461034b578063b370b7f51461039b578063b4c0d7ab14610396578063babb6aac14610391578063bce63c001461038c578063c2bb0c5514610387578063c35c83fc14610382578063ceb4c9871461037d578063d7e1583a14610378578063dda5211314610373578063ddd224f11461036e578063de7eba7814610369578063deff4b2414610364578063e45a46941461035f578063ea86bd461461035a578063ee2a53f814610355578063f2fde38b14610350578063f79f29ed1461034b578063fb4c3749146103465763fc8a584f0361000e576132a7565b61326d565b612b1a565b6131bb565b613173565b613070565b613023565b612f24565b612ed5565b612ea2565b612e72565b612e32565b612d2e565b612cf9565b612cb5565b612c68565b612bfc565b612bc3565b612b6b565b6129e5565b61291d565b6127ac565b61277b565b612757565b6126b8565b6125ad565b612523565b6124d6565b6124a6565b612428565b6123a6565b612285565b612243565b612196565b6120e9565b61084c565b6120a3565b611f9c565b611f5b565b611ebc565b611e4f565b611e05565b611dbb565b611d77565b611c92565b611c10565b611be0565b611b96565b611b09565b6119d3565b61196e565b61188e565b61185d565b6116cc565b61163b565b611613565b61153c565b6112e5565b6110e1565b610f77565b610f44565b610d0d565b610c70565b610b67565b6108ee565b610870565b6107ff565b61079f565b610541565b6104ad565b5f9103126104a957565b5f80fd5b346104a957d36104a957d26104a9575f3660031901126104a957602060405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b74ffffffffffffffffffffffffffffffffffffffffff8116036104a957565b6001600160a01b0360e43561052a816104f7565b1690565b6001600160a01b03903561052a816104f7565b346104a957d36104a957d26104a95760203660031901126104a957602060043561056a816104f7565b6001600160a01b038091165f526108d8825260405f205416604051908152f35b63ffffffff8116036104a957565b61010435906105a68261058a565b565b61012435906105a68261058a565b61014435906105a68261058a565b35906105a68261058a565b634e487b7160e01b5f52604160045260245ffd5b6040810190811067ffffffffffffffff8211176105ff57604052565b6105cf565b6101a0810190811067ffffffffffffffff8211176105ff57604052565b6060810190811067ffffffffffffffff8211176105ff57604052565b67ffffffffffffffff81116105ff57604052565b6080810190811067ffffffffffffffff8211176105ff57604052565b60e0810190811067ffffffffffffffff8211176105ff57604052565b60a0810190811067ffffffffffffffff8211176105ff57604052565b90601f8019910116810190811067ffffffffffffffff8211176105ff57604052565b6040519060c0820182811067ffffffffffffffff8211176105ff57604052565b60405190610180820182811067ffffffffffffffff8211176105ff57604052565b604051906105a682610604565b604051906105a682610651565b604051906105a68261066d565b67ffffffffffffffff81116105ff57601f01601f191660200190565b9291926107578261072f565b9161076560405193846106a5565b8294818452818301116104a9578281602093845f960137010152565b9080601f830112156104a95781602061079c9335910161074b565b90565b6101003660031901126104a9576107b76004356104f7565b6107c26024356104f7565b6084358060070b036104a9576107d960a43561058a565b60c43567ffffffffffffffff81116104a9576107f9903690600401610781565b506132ef565b346104a957d36104a957d26104a9575f3660031901126104a95760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206040515f8152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b60409060031901126104a957600435906108d6826104f7565b6001600160a01b038092169160243561052a816104f7565b346104a957d36104a957d26104a957610906366108bd565b9061090f613fbc565b610917613fdc565b6001600160a01b039081831692831515806109ad575b61099b5761096c90610951836001600160a01b03165f526108d860205260405f2090565b906001600160a01b03166001600160a01b0319825416179055565b167f323983f5343e25b2c1396361b1b791be31484841fdfb95b8615cd02d910b1e085f80a3610018600160c955565b60405163a63e8c6b60e01b8152600490fd5b50604051637e062a3560e11b8152602081600481885afa908115610a0e575f916109df575b508316828416141561092d565b610a01915060203d602011610a07575b6109f981836106a5565b810190614032565b5f6109d2565b503d6109ef565b61359b565b67ffffffffffffffff81116105ff5760051b60200190565b9080601f830112156104a9576020908235610a4581610a13565b93610a5360405195866106a5565b81855260208086019260051b8201019283116104a957602001905b828210610a7c575050505090565b81358152908301908301610a6e565b9080601f830112156104a9576020908235610aa581610a13565b93610ab360405195866106a5565b81855260208086019260051b8201019283116104a957602001905b828210610adc575050505090565b8380916001600160a01b038435610af2816104f7565b16815201910190610ace565b9291610b0982610a13565b91610b1760405193846106a5565b829481845260208094019160051b81019283116104a957905b828210610b3d5750505050565b81358152908301908301610b30565b9080601f830112156104a95781602061079c93359101610afe565b6003196060368201126104a957600435610b808161058a565b60243567ffffffffffffffff928382116104a95760c09082360301126104a957610ba86106c7565b90806004013582526024810135602083015260448101358481116104a957610bd69060043691840101610a2b565b6040830152610be7606482016105c4565b6060830152610bf86084820161052e565b608083015260a4810135908482116104a9576004610c199236920101610a8b565b60a08201526044359283116104a957610c39610018933690600401610b4c565b91613301565b9181601f840112156104a95782359167ffffffffffffffff83116104a9576020808501948460051b0101116104a957565b346104a957d36104a957d26104a9576003196060368201126104a95760043567ffffffffffffffff918282116104a95760609082360301126104a95760243590610cb98261058a565b6044359283116104a957610cd4610018933690600401610c3f565b9290916004016134ec565b9181601f840112156104a95782359167ffffffffffffffff83116104a957602083818601950101116104a957565b346104a957d36104a957d26104a95760603660031901126104a9576004803560243567ffffffffffffffff81116104a957610d4b9036908401610cdf565b610cbf929192805460ff8116610f335760ff19166001179055610d6d8261392f565b92610de5610d7c36848461074b565b6020815191012060206001600160a01b039660405180948192630829c59f60e01b83527f00000000000000000000000000000000000000000000000000000000000000006044358d85016001600160a01b03604092959493606083019683521660208201520152565b0381897f0000000000000000000000000000000000000000000000000000000000000000165afa918215610a0e575f92610f02575b5003610ef157610e2c918101906135a6565b92168015159081610ee6575b50610ed557610e5a610e53825f52610cbe60205260405f2090565b5460ff1690565b610ec457610eb79250610e86610e79825f52610cbe60205260405f2090565b805460ff19166001179055565b6040513381527f3b0b856314838f509dfe81e9e13c651b0e544b42639c58be2c161b2c3892949d90602090a261464e565b610cbf805460ff19169055005b604051630dc1019760e01b81528390fd5b6040516332f602d160e11b81528390fd5b90503014155f610e38565b6040516301b6e1e760e21b81528590fd5b610f2591925060203d602011610f2c575b610f1d81836106a5565b81019061358c565b905f610e1a565b503d610f13565b60405163087f80c160e31b81528690fd5b346104a957d36104a957d26104a9575f3660031901126104a9576020604051428152f35b90816101809103126104a95790565b346104a957d36104a957d26104a95760403660031901126104a95760043567ffffffffffffffff81116104a957610fb2903690600401610f68565b610fbb816135e6565b6001600160a01b031690610fd1602082016135e6565b6001600160a01b031691610fe7604083016135e6565b6001600160a01b0316610ffc606084016135e6565b6001600160a01b031692611012608082016135e6565b6001600160a01b03169061010061102a8183016135f0565b906101209061103a8483016135f0565b926101409485810161104b906135f0565b966101609a8b830161105d90846135fa565b9a909b6110686106e7565b9e8f91825260208201526040015260608d015260808c015260a081013560a08c015260c081013560c08c015260e0013560e08b015263ffffffff16908901528701906110b9919063ffffffff169052565b63ffffffff9091169085015236906110d09261074b565b908201523360243561001892613f20565b346104a957d36104a957d26104a95760203660031901126104a9576004803567ffffffffffffffff81116104a95761111c9036908301610f68565b611124613fdc565b60ff6108cf5460e01c166112d55763ffffffff8042169261014083019361115d8161114e876135f0565b63ffffffff9182169116101590565b6112c557610120840192611170846135f0565b16106112b6576111886111833685612d56565b613eef565b9061119c825f526108d660205260405f2090565b546112a857506111eb7f3cee3e290f36226751cd0b3321b213890fe9c768e922f267fa6111836ce05c32926111e66111e06111f1945f526108d660205260405f2090565b60019055565b6135f0565b936135f0565b61121161120c6112056101608601866135fa565b369161074b565b61467c565b9061129b6040519283926101008701359760e08801359760208101359281359260408301359260c08101359060a081013590606060808201359101358b9693909a999895919261012098959361014089019c895260208901526040880152606087015263ffffffff80921660808701521660a085015260c084015260e08301526101008201520152565b0390a3610018600160c955565b604051624be79160e21b8152fd5b60405163d642b7d960e01b8152fd5b50604051630277ae7b60e21b8152fd5b50604051633d90fc5560e11b8152fd5b346104a957d36104a957d26104a95760203660031901126104a95760043561130c816104f7565b6001600160a01b03809116611374827f00000000000000000000000000000000000000000000000000000000000000001661134981301415613650565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc93845416146136c2565b61137c613fbc565b611384612b9c565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156113b9575061001891506152fc565b906040516352d1902d60e01b8152602081600481855afa5f9181611450575b5061143d5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b0390fd5b6100189361144b9114614691565b6151db565b61146a91925060203d602011610f2c57610f1d81836106a5565b905f6113d8565b60206003198201126104a9576004359067ffffffffffffffff82116104a95761149c91600401610c3f565b9091565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b6020808201908083528351809252604092604081018260408560051b8401019601945f925b8584106114fa575050505050505090565b90919293949596858061152b600193603f1986820301885286838d51805115158452015191818582015201906114a0565b9901940194019295949391906114e9565b346104a957d36104a957d26104a95761155436611471565b61155d81610a13565b91604061156d60405194856106a5565b828452601f1961157c84610a13565b015f5b8181106115f05750505f5b8381106115a3576040518061159f87826114c4565b0390f35b806115ea6115b360019388613734565b515f806115c1858a8a613748565b906115d089518093819361375f565b0390305af4906115de61376c565b60208201529015159052565b0161158a565b60209083516115fe816105e3565b5f81528260608183015282890101520161157f565b346104a957d36104a957d26104a9575f3660031901126104a95760206040516301e133808152f35b346104a957d36104a957d26104a95760403660031901126104a957602435600435611664613fbc565b61166c613fdc565b6108d08054680100000000000000008110156105ff5763ffffffff916001820190558361169882613134565b5084600182015555167fc86ba04c55bc5eb2f2876b91c438849a296dbec7b08751c3074d92e04f0a77af5f80a4600160c955005b60403660031901126104a9576004356116e4816104f7565b6001600160a01b0380911660243567ffffffffffffffff81116104a95761170f903690600401610781565b61176c837f00000000000000000000000000000000000000000000000000000000000000001661174181301415613650565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc94855416146136c2565b611774613fbc565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156117a9575061001891506152fc565b906040516352d1902d60e01b8152602081600481855afa5f918161183c575b506118295760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b610018936118379114614691565b6152aa565b61185691925060203d602011610f2c57610f1d81836106a5565b905f6117c8565b346104a957d36104a957d26104a9575f3660031901126104a95760206001600160a01b036108cd5416604051908152f35b346104a957d36104a957d26104a9575f3660031901126104a9576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611903576040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152602090f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b6101203660031901126104a9576119866004356104f7565b6119916024356104f7565b61199c6044356104f7565b60a4358060070b036104a9576119b360c43561058a565b60e43567ffffffffffffffff81116104a9576107f9903690600401610781565b346104a957d36104a957d26104a95760203660031901126104a95760043567ffffffffffffffff81116104a957611a0e903690600401610781565b611a16614703565b610cbf805460ff8116611af75760ff191660011790556040516349b5c56d60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a0e575f91611ad8575b50428111908115611aa5575b50611a9357610eb79061464e565b604051633ff377d160e11b8152600490fd5b611ab09150426137af565b7f0000000000000000000000000000000000000000000000000000000000000000115f611a85565b611af1915060203d602011610f2c57610f1d81836106a5565b5f611a79565b60405163087f80c160e31b8152600490fd5b346104a957d36104a957d26104a95760c03660031901126104a957600435611b30816104f7565b6001600160a01b03606435611b44816104f7565b67ffffffffffffffff926084358481116104a957611b66903690600401610cdf565b9160a4359586116104a95784611b83610018973690600401610cdf565b9690951691604435916024359116613814565b346104a957d36104a957d26104a9575f3660031901126104a957602060405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346104a957d36104a957d26104a9575f3660031901126104a957602060ff6108cf5460e81c166040519015158152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b60609060031901126104a957600435611c6c8161058a565b9060243590611c7a826104f7565b6001600160a01b038092169160443561052a816104f7565b346104a957d36104a957d26104a957611cef611cad36611c54565b905f9392935493611cd560ff8660081c161580968197611d69575b8115611d49575b50613884565b84611ce6600160ff195f5416175f55565b611d32576138f6565b611cf557005b611d0361ff00195f54165f55565b604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a1005b611d4461010061ff00195f5416175f55565b6138f6565b303b15915081611d5b575b505f611ccf565b6001915060ff16145f611d54565b600160ff8216109150611cc8565b346104a957d36104a957d26104a9575f3660031901126104a95760206040517f8d1994e2bbbd77564cdca06dd819e7ee2a5efa06c80dcb59a4a7b6e39edc538f8152f35b346104a957d36104a957d26104a9575f3660031901126104a957602060405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346104a957d36104a957d26104a9575f3660031901126104a957602060405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346104a957d36104a957d26104a9575f3660031901126104a957611e71614703565b5f6001600160a01b036033546001600160a01b03198116603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b801515036104a957565b346104a957d36104a957d26104a95760203660031901126104a9577fe88463c2f254e2b070013a2dc7ee1e099f9bc00534cbdf03af551dc26ae492196020600435611f0681611eb2565b611f0e613fbc565b611f16613fdc565b15156108cf80547fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60ff60e81b8460e81b169116179055604051908152a1600160c955005b346104a957d36104a957d26104a95760203660031901126104a9576020611f8360043561392f565b604051908152f35b90602061079c9281815201906114a0565b346104a957d36104a957d26104a95760203660031901126104a957600480359067ffffffffffffffff82116104a957611ffb611fe36001600160a01b039336908401610cdf565b611feb613fbc565b611ff3613fdc565b8101906135a6565b921680156120935781835110612083575f8084516020860182855af19161202061376c565b921561207457507f41a941b8313293eca483f41d8faa2498e005e6d7700e2e93f41d3cb7e70a897d61205b61159f9460405191829182611f8b565b0390a2612068600160c955565b60405191829182611f8b565b6040516348ebf0a960e11b8152fd5b50604051637f5e6be560e01b8152fd5b50604051634e93b52160e11b8152fd5b346104a957d36104a957d26104a9575f3660031901126104a95760206040517f000000000000000000000000000000000000000000000000000000000000000015158152f35b6101603660031901126104a957600435612102816104f7565b6001600160a01b03602435612116816104f7565b60443592612123846104f7565b60643590612130826104f7565b60e4359261213d846104f7565b612145610598565b9161214e6105a8565b93610144359067ffffffffffffffff82116104a9576100189861217689933690600401610cdf565b999098169460c4359460a43594808080608435971695169316911661396a565b6101803660031901126104a9576004356121af816104f7565b6001600160a01b036024356121c3816104f7565b604435916121d0836104f7565b606435936121dd856104f7565b6121e5610516565b6121ed610598565b906121f66105a8565b926121ff6105b6565b94610164359867ffffffffffffffff8a116104a9576122256100189a3690600401610cdf565b99909860c4359460a43594808080608435971695169316911661398c565b346104a957d36104a957d26104a95760603660031901126104a9576020611f8360043561226f816104f7565b604435906001600160a01b036024359116613a9d565b346104a957d36104a957d26104a95760603660031901126104a95767ffffffffffffffff6024358181116104a9576122c1903690600401610cdf565b916044359081116104a9576122da903690600401610cdf565b90604051936020850194806122f14684888a613ad3565b0395612305601f19978881018452836106a5565b6004359151902003612394575f946123346123569361232b87612362958a990190612e0c565b95810190613af0565b519360405193849160208301966337bfd2c960e21b8852339160248501613bb8565b039081018352826106a5565b5190305af461236f61376c565b901561237757005b60405163b8fe37a760e01b81529081906114399060048301611f8b565b604051630f0c8f4760e11b8152600490fd5b346104a957d36104a957d26104a95760203660031901126104a9576004356123cc613fbc565b6123d4613fdc565b6123dd81613134565b612415576001815f80935501557f7c1af0646963afc3343245b103731965735a893347bfa0d58a5dc77a77ae691c5f80a2600160c955005b634e487b7160e01b5f525f60045260245ffd5b6101a03660031901126104a957610124356124428161058a565b6101443561244f8161058a565b610164359161245d8361058a565b610184359267ffffffffffffffff84116104a957612482610018943690600401610cdf565b9390926101043560e43560c43560a435608435606435604435602435600435613bda565b346104a957d36104a957d26104a9575f3660031901126104a95760206001600160a01b0360335416604051908152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346104a957d36104a957d26104a95760e03660031901126104a95767ffffffffffffffff6004358181116104a95761255f903690600401610f68565b60a4358281116104a957612577903690600401610cdf565b60c4929192359384116104a957612595610018943690600401610cdf565b93909260843590606435906044359060243590613c52565b346104a957d36104a957d26104a9576100186126046126b36125ce36611c54565b9390916125e160ff5f5460081c16613d3b565b6108cf9063ffffffff60c01b1963ffffffff60c01b83549260c01b169116179055565b604051612610816105e3565b6009815260208101907f4143524f53532d56320000000000000000000000000000000000000000000000825260405191612649836105e3565b6005835260208301917f312e302e30000000000000000000000000000000000000000000000000000000835261268e60ff5f5460081c1661268981613d3b565b613d3b565b51902091519020906104e3556104e4556126a6614bb4565b6126ae614bc4565b614bdf565b614c39565b346104a957d36104a957d26104a95760203660031901126104a9577f2d5b62420992e5a4afce0e77742636ca2608ef58289fd2e1baa5161ef6e7e41e602060043561270281611eb2565b61270a613fbc565b612712613fdc565b15156108cf80547fffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff60ff60e01b8460e01b169116179055604051908152a1600160c955005b346104a957d36104a957d26104a9575f3660031901126104a9576020604051468152f35b346104a957d36104a957d26104a9575f3660031901126104a957602063ffffffff6108cf5460c01c16604051908152f35b346104a957d36104a957d26104a95760403660031901126104a9576004356024356127d682614f88565b6001600160a01b0382165f526108d760205261280560405f20336001600160a01b03165f5260205260405f2090565b549182156128a8575f61284c3361283661281e85614325565b6001600160a01b03165f526108d760205260405f2090565b906001600160a01b03165f5260205260405f2090565b556128788361286961285d84614325565b6001600160a01b031690565b61287285614325565b90614c93565b60405192835233927f6c172ea51018fb2eb2118f3f8a507c4df71eb519b8c0052834dc3c920182fef490602090a4005b6040516336542bf760e21b8152600490fd5b6020808201906020835283518092526040830192602060408460051b8301019501935f915b8483106128ef5750505050505090565b909192939495848061290d600193603f198682030187528a516114a0565b98019301930191949392906128df565b346104a957d36104a957d26104a95761293536611471565b9061293f82613dad565b915f5b818110612957576040518061159f86826128ba565b5f80612964838587613748565b6040939161297685518093819361375f565b0390305af49061298461376c565b91156129ab5750906001916129998287613734565b526129a48186613734565b5001612942565b9060448151106104a9576114396129d060049283810151602480918301019101613df6565b925162461bcd60e51b81529283928301611f8b565b610180806003193601126104a95761010435612a008161058a565b6101243591612a0e8361058a565b6101443592612a1c8461058a565b6101643567ffffffffffffffff81116104a957612a3d903690600401610cdf565b612a45613fdc565b6108cf549260ff8460e81c16612b0857612afe96612ae761120592612ad963ffffffff612af59860c01c1699612a7d6125e18c613e59565b612a85610708565b9a6004358c5260243560208d015260443560408d015260643560608d015260843560808d015260a43560a08d015260c43560c08d015260e43560e08d01526101008c01526101208b019063ffffffff169052565b63ffffffff16610140890152565b63ffffffff16610160870152565b908201526148d4565b610018600160c955565b604051630b4cba3160e31b8152600490fd5b346104a957d36104a957d26104a9576020612b626001600160a01b03612b3f366108bd565b91165f526108d7835260405f20906001600160a01b03165f5260205260405f2090565b54604051908152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206001600160a01b036108ce5416604051908152f35b6040516020810181811067ffffffffffffffff8211176105ff576040525f8152905f368137565b346104a957d36104a957d26104a9575f3660031901126104a95761159f612be8612b9c565b6040519182916020835260208301906114a0565b346104a957d36104a957d26104a95760c03660031901126104a95767ffffffffffffffff6084358181116104a957612c38903690600401610cdf565b9060a4359283116104a957612c54610018933690600401610cdf565b929091606435604435602435600435613e6e565b346104a957d36104a957d26104a9575f3660031901126104a95760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346104a957d36104a957d26104a95760203660031901126104a9576004355f526108d6602052602060405f2054604051908152f35b346104a957d36104a957d26104a9575f3660031901126104a957602060405163ffffffff8152f35b9190610180838203126104a957612d6b6106e7565b92803584526020810135602085015260408101356040850152606081013560608501526080810135608085015260a081013560a085015260c081013560c085015260e081013560e08501526101008082013590850152610120612dcf8183016105c4565b90850152610140612de18183016105c4565b90850152610160918282013567ffffffffffffffff81116104a957612e069201610781565b90830152565b906020828203126104a957813567ffffffffffffffff81116104a95761079c9201612d56565b346104a957d36104a957d26104a95760203660031901126104a95760043567ffffffffffffffff81116104a957611f836111836020923690600401612d56565b346104a957d36104a957d26104a9575f3660031901126104a957602060ff6108cf5460e01c166040519015158152f35b346104a957d36104a957d26104a9575f3660031901126104a95760206040516ec097ce7bc90715b34b9f10000000008152f35b346104a957d36104a957d26104a95760203660031901126104a957612f1d6001600160a01b03600435612f07816104f7565b612f0f613fbc565b612f17613fdc565b16614bdf565b600160c955005b346104a957d36104a957d26104a95760603660031901126104a95760043567ffffffffffffffff81116104a957612f5f903690600401612d56565b612f67613fdc565b60ff6108cf5460e01c166130115761014081015163ffffffff4281169116101580612ff2575b612fe05780612f9e612afe92613eef565b60c082015160208301519061016084015192612fb86106c7565b948552602085015260408401526060830152608082015260243560a0820152604435906143c7565b604051630c3a9b9d60e41b8152600490fd5b506130006040820151614325565b6001600160a01b0316331415612f8d565b604051633d90fc5560e11b8152600490fd5b346104a957d36104a957d26104a9575f3660031901126104a95760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b610160806003193601126104a9576101043561308b8161058a565b610124356130988161058a565b6101443567ffffffffffffffff81116104a9576130b9903690600401610cdf565b63ffffffff946130cc8642169586613952565b936130d5613fdc565b6108cf549160ff8360e81c16612b085761310861311596612ad9612afe9a6112059660c01c1699612a7d6125e18c613e59565b86019063ffffffff169052565b6101808201526148d4565b634e487b7160e01b5f52603260045260245ffd5b6108d090815481101561316e576003915f52027f6404fdb155c59a831d14e4acb0957279f1e3a856a4513ac322398c7bc9a5781b01905f90565b613120565b346104a957d36104a957d26104a95760203660031901126104a9576004356108d0548110156104a9576131a7604091613134565b506001815491015482519182526020820152f35b346104a957d36104a957d26104a95760203660031901126104a9576001600160a01b036004356131ea816104f7565b166131f3614703565b80156132025761001890614837565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b346104a957d36104a957d26104a95760203660031901126104a9576004355f52610cbe602052602060ff60405f2054166040519015158152f35b346104a957d36104a957d26104a95760203660031901126104a957612f1d6001600160a01b036004356132d9816104f7565b6132e1613fbc565b6132e9613fdc565b16614c39565b6040516332ed1ba560e21b8152600490fd5b919061330b613fdc565b60208101918251460361341d576133336133379183600161332b88613134565b500154614050565b1590565b61340b577ff4ad92585b1bc117fbdd644990adf0827bc4c95baeae8a23322af807b6d0020e6060820192613378613372855163ffffffff1690565b866140e2565b80516133fe84519260408601956133e36133d56133c489519661339f8c5163ffffffff1690565b9760808601986133b68a516001600160a01b031690565b9160a088019b8c5194614144565b925193519851995163ffffffff1690565b94516001600160a01b031690565b945163ffffffff9586604051978897169b169933948761349e565b0390a46105a6600160c955565b60405163582f497d60e11b8152600490fd5b604051633d23e4d160e11b8152600490fd5b9081518082526020808093019301915f5b82811061344e575050505090565b835185529381019392810192600101613440565b9081518082526020808093019301915f5b828110613481575050505090565b83516001600160a01b031685529381019392810192600101613473565b94969591936134c060a0956134de93885260c0602089015260c088019061342f565b906001600160a01b0380951660408801528682036060880152613462565b951515608085015216910152565b9192906134f7613fdc565b823561017e19843603018112156104a9576135829461357d936135206135769336908801612d56565b9561352e6080880151614325565b5061353887613eef565b9060406020890151916101608a0151936135506106c7565b9a8b5260208b015201356040890152606088015260808701525f60a08701523691610afe565b9083614337565b614535565b6105a6600160c955565b908160209103126104a9575190565b6040513d5f823e3d90fd5b9190916040818403126104a9576001600160a01b0381356135c6816104f7565b1692602082013567ffffffffffffffff81116104a95761079c9201610781565b3561079c816104f7565b3561079c8161058a565b903590601e19813603018212156104a9570180359067ffffffffffffffff82116104a9576020019181360383136104a957565b634e487b7160e01b5f52602160045260245ffd5b6003111561364b57565b61362d565b1561365757565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608490fd5b156136c957565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608490fd5b805182101561316e5760209160051b010190565b9082101561316e5761149c9160051b8101906135fa565b908092918237015f815290565b3d15613796573d9061377d8261072f565b9161378b60405193846106a5565b82523d5f602084013e565b606090565b634e487b7160e01b5f52601160045260245ffd5b919082039182116137bc57565b61379b565b908060209392818452848401375f828201840152601f01601f1916010190565b949290936138069261079c9795875260208701526080604087015260808601916137c1565b9260608185039101526137c1565b9293957f45e04bc8f121ba11466985789ca2822a91109f31bb8ac85504a37b7eaf873c269561387f939892976001600160a01b038097166138718a8c8361385c36888861074b565b91613868368b8b61074b565b9346908d61475b565b604051978897169a876137e1565b0390a3565b1561388b57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b6105a692916126046126b39261391660ff5f5460081c1661268981613d3b565b61391f33614837565b6125e160ff5f5460081c16613d3b565b604051602081019182525f60408201526040815261394c81610621565b51902090565b91909163ffffffff808094169116019182116137bc57565b96949290916105a69b9a999896949261398a63ffffffff42169889613952565b985b9593919b999897969492909b6139a0613fdc565b6108cf549660ff8860e81c16612b08578760c01c63ffffffff166139c390613e59565b6139ea906108cf9063ffffffff60c01b1963ffffffff60c01b83549260c01b169116179055565b6139f2610708565b9d6001600160a01b038f921682526001600160a01b031690602001526001600160a01b031660408d01526001600160a01b031660608c015260808b015260a08a015260c08901526001600160a01b031660e088015260c01c63ffffffff16610100870152610120860190613a6b919063ffffffff169052565b63ffffffff1661014085015263ffffffff166101608401523690613a8e9261074b565b610180820152613582906148d4565b916040519160208301936bffffffffffffffffffffffff199060601b168452603483015260548201526054815261394c81610651565b939291602091613aeb916040875260408701916137c1565b930152565b908160209103126104a957604051906020820182811067ffffffffffffffff8211176105ff5760405235815290565b61079c9161018090825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015190820152613b94610120808501519083019063ffffffff169052565b6101408381015163ffffffff169082015281610160809401519382015201906114a0565b613bd060409295949395606083526060830190613b1f565b9460208201520152565b9c9a9998979695949392919096613bef613fdc565b60ff6108cf5460e81c16612b0857613c08908e33613a9d565b96604051809e613c1782610604565b81526020015260408d015260608c015260808b015260a08a015260c089015260e088015261010087015263ffffffff16610120860152613a6b565b979290959391969497613c63613fdc565b60ff6108cf5460e01c1661301157613c7e61014082016135f0565b63ffffffff8042169116101580613d1c575b612fe057613d05613d1796613cfd6135829b613caf6111833687612d56565b9a613cb86106c7565b9b613cc33688612d56565b8d5260208d01528660408d01528760608d0152613ce1368b8461074b565b60808d015260a08c0152613cf58535614325565b98369161074b565b95369161074b565b9461010060e08301359201359061475b565b6143c7565b50613d2a6040820135614325565b6001600160a01b0316331415613c90565b15613d4257565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608490fd5b90613db782610a13565b613dc460405191826106a5565b8281528092613dd5601f1991610a13565b01905f5b828110613de557505050565b806060602080938501015201613dd9565b6020818303126104a95780519067ffffffffffffffff82116104a9570181601f820112156104a957805190613e2a8261072f565b92613e3860405194856106a5565b828452602083830101116104a957815f9260208093018386015e8301015290565b63ffffffff8091169081146137bc5760010190565b9690957f45e04bc8f121ba11466985789ca2822a91109f31bb8ac85504a37b7eaf873c2695613ee5939495613ea1613fdc565b613eaa8a614f88565b613ed9898b8989613ebc36888861074b565b92613ec8368b8b61074b565b946001600160a01b0346921661475b565b604051968796876137e1565b0390a3600160c955565b60405161394c81613f0c6020820194604086526060830190613b1f565b46604083015203601f1981018352826106a5565b919091613f2b613fdc565b60ff6108cf5460e01c166130115761014081015163ffffffff4281169116101580613f9d575b612fe05761358292613f6282613eef565b60c083015160208401519061016085015192613f7c6106c7565b958652602086015260408501526060840152608083015260a08201526143c7565b50613fab6040820151614325565b6001600160a01b0316331415613f51565b60ff610cbf541615613fca57565b604051631147e02f60e11b8152600490fd5b600260c95414613fed57600260c955565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b908160209103126104a9576001600160a01b03905161052a816104f7565b61079c92916040516140d9816140cb602082019460208652805160408401526020810151606084015260a0614095604083015160c0608087015261010086019061342f565b606083015163ffffffff168583015260808301516001600160a01b031660c0860152910151838203603f190160e0850152613462565b03601f1981018352826106a5565b51902091614cdb565b6140ed600291613134565b500162ffffff8260081c16805f5281602052600160ff60405f205494161b8080941614614125575f5260205260405f20908154179055565b60405163954476d960e01b8152600490fd5b919082018092116137bc57565b91959495939092935f968151908181510361431357816141c3575b5050508261416e575b50505050565b6001600160a01b03816141a27ffa7fa7cf6d7dde5f9be65a67e6a1a747e7aa864dcd2d793353c722d80fbbb3579386614d9e565b6040805195865233602087015291169463ffffffff1693a45f808080614168565b604080516370a0823160e01b81523060048083019190915291906020816024816001600160a01b038b165afa908115610a0e575f916142f4575b505f805b86811061421257505050505061415f565b61421c8189613734565b5161422a575b600101614201565b9061424090614239838a613734565b5190614137565b908282116142e45761427a61333361426861425b848a613734565b516001600160a01b031690565b614272848c613734565b51908c614d2c565b15614222579c50876142da6142d28f6142bd61425b6142b661429c848f613734565b51966001600160a01b03165f526108d760205260405f2090565b928b613734565b6001600160a01b03165f5260205260405f2090565b918254614137565b905560019c614222565b50505051632ddaa83160e11b8152fd5b61430d915060203d602011610f2c57610f1d81836106a5565b5f6141fd565b6040516319a5316760e31b8152600490fd5b6001600160a01b039061052a81614f88565b91613333906143b09284516040809601519186519161435583610621565b82526140d96143706020840192468452898501958652613134565b50549388519283916143956020840196602088525160608d86015260a0850190613b1f565b9151606084015251608083015203601f1981018352826106a5565b6143b75750565b5163582f497d60e11b8152600490fd5b80519061012082019263ffffffff84511642116145235760208201519360016143f9865f526108d660205260405f2090565b540361451d5760015b6002614417875f526108d660205260405f2090565b541461450b5760026144356105a6975f526108d660205260405f2090565b557f44b559f101f8fbcc8a0ea43fa91a05a729a5ea6e14a7c75aa75037469013720860608601516080870151906145038760a08a0151958a60c08101519760a08401519860e0830151996144936101008501519c5163ffffffff1690565b61014085015163ffffffff16916040860151938651956144f76144bf61016060208b01519a015161467c565b9960608c01519b60406144d5608083015161467c565b9101519060206144e3610715565b9e8f528e015260408d015260608c01614fa3565b6040519c8d9c8d614faf565b0390a4615064565b604051630479306360e51b8152600490fd5b5f614402565b60405163d642b7d960e01b8152600490fd5b805161012081019163ffffffff83511642116145235760208101516002614565825f526108d660205260405f2090565b541461450b576105a69360026145855f935f526108d660205260405f2090565b5560608401517f44b559f101f8fbcc8a0ea43fa91a05a729a5ea6e14a7c75aa750374690137208608086015160a0870151926146468760c08a0151958a60a08301519760e0820151986145e26101008401519b5163ffffffff1690565b61014084015163ffffffff169060408501519285519461460b610160602089015198015161467c565b9760608a0151996040614621608083015161467c565b9101519061462d610715565b9b8c5260208c015260408b0152600260608b01526144f7565b0390a4615168565b5f8091602081519101305af461466261376c565b501561466a57565b6040516318cecad560e01b8152600490fd5b8051908161468a5750505f90565b6020012090565b1561469857565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608490fd5b6001600160a01b0360335416330361471757565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b93926042936105a6979660208151910120906040519260208401947f8d1994e2bbbd77564cdca06dd819e7ee2a5efa06c80dcb59a4a7b6e39edc538f86526040850152856060850152608084015260a083015260c082015260c081526147c08161066d565b519020906104e354906104e454906040519160208301937fc2f8787176b8ac6bf7215b4adcc1e069bf4ab82d9ab1df05a57a91d425935b6e85526040840152606083015260808201526080815261481681610689565b519020906040519161190160f01b83526002830152602282015220906153aa565b603354906001600160a01b0380911691826001600160a01b0319821617603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b969261079c9a9996949198959261014099895260208901526040880152606087015263ffffffff928380921660808801521660a08601521660c084015260e08301526101008201528161012082015201906114a0565b6148de8151614f88565b6060810190815115614ba35761012081019061490a614901835163ffffffff1690565b63ffffffff1690565b804210908115614b6a575b50614b585761014081019261492e845163ffffffff1690565b9163ffffffff9283614962817f00000000000000000000000000000000000000000000000000000000000000001642614137565b911611614b465761016081015163ffffffff169280841680614b01575b505060408101918251926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001680941480614af8575b15614aa85760808301513403614a9657833b156104a9575f60049460405195868092630d0e30db60e41b825234905af1908115610a0e577f32ed1a409ef04c7b0227189c3a103dc5ac10e775a15b785dcc510201f7c25ad394614a7892614a7d575b505b5191519260808101519060a081015160c082015197614a57614a4c6101008501519b5163ffffffff1690565b9b5163ffffffff1690565b83519b60208501519361018060e0870151960151966040519a8b9a8b61487e565b0390a4565b80614a8a614a909261063d565b8061049f565b5f614a1e565b604051636452a35d60e01b8152600490fd5b925034614a9657614a7883614af3614ae461285d7f32ed1a409ef04c7b0227189c3a103dc5ac10e775a15b785dcc510201f7c25ad39751614325565b60808601519030903390615488565b614a20565b503415156149bc565b6301e133801015614b31575b5060e081015115614b1f575f8061497f565b60405163495d907f60e01b8152600490fd5b92614b3f9193421690613952565b915f614b0d565b60405163582e388960e01b8152600490fd5b60405163f722177f60e01b8152600490fd5b614b759150426137af565b63ffffffff7f000000000000000000000000000000000000000000000000000000000000000016105f614915565b6040516231010160e51b8152600490fd5b6105a660ff5f5460081c16613d3b565b614bd860ff5f5460081c1661268981613d3b565b600160c955565b6001600160a01b03168015614c27576108cd816001600160a01b03198254161790557fa9e8c42c9e7fca7f62755189a16b2f5314d43d8fb24e91ba54e6d65f9314e8495f80a2565b60405163ba97b39d60e01b8152600490fd5b6001600160a01b03168015614c81576108ce816001600160a01b03198254161790557fa73e8909f8616742d7fe701153d82666f7b7cd480552e23ebb05d358c22fd04e5f80a2565b604051635b03092b60e11b8152600490fd5b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448201929092526105a691614cd682606481015b03601f1981018452836106a5565b6154dc565b929091905f915b8451831015614d2457614cf58386613734565b519081811015614d13575f52602052600160405f205b920191614ce2565b905f52602052600160405f20614d0b565b915092501490565b60405163a9059cbb60e01b60208281019182526001600160a01b039094166024830152604482019490945290925f91614d6881606481016140cb565b519082855af1903d5f519083614d7f575b50505090565b91925090614d9457503b15155b5f8080614d79565b6001915014614d8c565b91906001600160a01b0380614dc5836001600160a01b03165f526108d860205260405f2090565b5416817f000000000000000000000000000000000000000000000000000000000000000016151580614f5b575b15614e1757505050906105a690614e126108ce546001600160a01b031690565b6155ce565b8015614f4957816108ce541691614e2c61599b565b50614e356159e2565b50614e3e612b9c565b614e46612b9c565b614e4e612b9c565b91614e57610722565b63ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152956020870152604098808a8801526060870152608086015260a085015260c0840152855193633b6f743b60e01b8552868580614ebf8760048301615aa3565b0381865afa948515610a0e575f95614f1a575b5084513410614f09576105a6959650614eec8551346137af565b80614ef9575b5016615c31565b614f039033615aba565b5f614ef2565b865163557a94ff60e11b8152600490fd5b614f3b919550873d8911614f42575b614f3381836106a5565b810190615a22565b935f614ed2565b503d614f29565b60405163d623472560e01b8152600490fd5b50817f00000000000000000000000000000000000000000000000000000000000000001682841614614df2565b60a01c614f9157565b6040516379ec0ed760e11b8152600490fd5b614fac82613641565b52565b9a989693919c9b9997959492909c6101e08c019d8c5260208c015260408b015260608a0152608089015263ffffffff80921660a08901521660c087015260e08601526101008501526101208401526101408301528051610160830152602081015161018083015260408101516101a0830152606001519061502f82613641565b6101c00152565b9061079c94936080936001600160a01b038093168452602084015216604082015281606082015201906114a0565b906080615072910151614325565b906040810151906150866060820151614325565b9060806001600160a01b03918286168585857f00000000000000000000000000000000000000000000000000000000000000001683145f1461515857506150d09130903390615488565b6150dc8584861661587b565b015191825115158061514e575b6150f5575b5050505050565b16803b156104a957615123935f809460405196879586948593633a5be8cb60e01b8552339160048601615036565b03925af18015610a0e5761513b575b808080806150ee565b80614a8a6151489261063d565b5f615132565b50803b15156150e9565b615163923390615488565b6150dc565b906080615176910151614325565b9060408101519061518a6060820151614325565b9060806001600160a01b03918286168585857f00000000000000000000000000000000000000000000000000000000000000001683145f146151d2576150dc9250851661587b565b61516392614c93565b906151e5826152fc565b6001600160a01b0382167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28051158015906152a3575b615226575050565b6152a0915f806040519361523985610621565b602785527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208601527f206661696c6564000000000000000000000000000000000000000000000000006040860152602081519101845af461529a61376c565b91615f3e565b50565b505f61521e565b906152b4826152fc565b6001600160a01b0382167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28051158015906152f457615226575050565b50600161521e565b803b1561533f576001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc91166001600160a01b0319825416179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608490fd5b6153b48383615d71565b600581959295101561364b57159384615472575b5083156153ec575b505050156153da57565b60405163938a182160e01b8152600490fd5b5f929350908291604051615424816140cb6020820194630b135d3f60e11b998a875260248401526040604484015260648301906114a0565b51915afa9061543161376c565b82615464575b82615447575b50505f80806153d0565b61545c9192506020808251830101910161358c565b145f8061543d565b915060208251101591615437565b6001600160a01b0383811691161493505f6153c8565b90926105a693604051936323b872dd60e01b60208601526001600160a01b038092166024860152166044840152606483015260648252614cd682610689565b908160209103126104a9575161079c81611eb2565b604051615533916001600160a01b03166154f5826105e3565b5f806020958685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656487860152868151910182855af161529a61376c565b8051908282159283156155b6575b5050501561554c5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b6155c693508201810191016154c7565b5f8281615541565b906001600160a01b038092167f000000000000000000000000000000000000000000000000000000000000000090837f0000000000000000000000000000000000000000000000000000000000000000169361562b848685615e9a565b604094604051926332dd704760e21b84526020956004948781600481875afa968715610a0e5788915f9861585a575b506040516352b7631960e11b81529086166001600160a01b03811660048301529097909588916024918391165afa958615610a0e575f9661583b575b5095867f0000000000000000000000000000000000000000000000000000000000000000975b6156cb57505050505050505050565b8681111561583557865b881561578d57843b156104a9578951634701287760e11b815287810182815263ffffffff7f0000000000000000000000000000000000000000000000000000000000000000166020820152604081018690526001600160a01b03881660608201525f6080820181905260a082018190526107d060c0830152919391908490819060e0010381838a5af1928315610a0e576157749361577a575b506137af565b806156bc565b80614a8a6157879261063d565b5f61576e565b89516337e9a82760e11b815287810182815263ffffffff7f0000000000000000000000000000000000000000000000000000000000000000166020820152604081018690526001600160a01b038816606082015290929084908490819060800103815f8a5af1928315610a0e576157749361580857506137af565b61582790853d871161582e575b61581f81836106a5565b810190615d5d565b505f61576e565b503d615815565b806156d5565b615853919650873d8911610f2c57610f1d81836106a5565b945f615696565b8691985061587490833d8511610a07576109f981836106a5565b979061565a565b906001600160a01b03808316803b158015615939575b1561590c57507f00000000000000000000000000000000000000000000000000000000000000001691823b156104a957604051632e1a7d4d60e01b815260048101839052925f908490602490829084905af1928315610a0e576105a6936158f9575b50615aba565b80614a8a6159069261063d565b5f6158f3565b906105a693507f000000000000000000000000000000000000000000000000000000000000000016614c93565b50803b6159458161072f565b61595260405191826106a5565b81815260208101915f83853c51905162ffffff60e81b908181169260038110615985575b50501661ef0160f01b14615891565b829350829060030360031b1b1616905f80615976565b6040519060e0820182811067ffffffffffffffff8211176105ff57604052606060c0835f81525f60208201525f60408201525f838201528260808201528260a08201520152565b604051906159ef826105e3565b5f6020838281520152565b91908260409103126104a957604051615a12816105e3565b6020808294805184520151910152565b906040828203126104a95761079c916159fa565b61079c9163ffffffff825116815260208201516020820152604082015160408201526060820151606082015260c0615a92615a80608085015160e0608086015260e08501906114a0565b60a085015184820360a08601526114a0565b9201519060c08184039101526114a0565b91906020613aeb5f92604086526040860190615a36565b814710615b4d575f8080936001600160a01b038294165af1615ada61376c565b5015615ae257565b60405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608490fd5b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606490fd5b519067ffffffffffffffff821682036104a957565b919082810360c081126104a9576080136104a95761079c906080604051615bcd81610621565b85518152615bdd60208701615b92565b6020820152615bef83604088016159fa565b604082015294016159fa565b9193926001600160a01b03906020615c1d606094608087526080870190615a36565b968051828701520151604085015216910152565b918351927f00000000000000000000000000000000000000000000000000000000000000008411615d4b57478411615d39576020850151615d27576001600160a01b0394615cad94615c8f60c0956040860151988991168095615da2565b60405180968195829463c7c7f5b360e01b8452309160048501615bfb565b03925af1908115610a0e575f91615cf6575b5060208101518203615ce4575103615cd357565b604051623c548b60ea1b8152600490fd5b604051631bfc3cb560e11b8152600490fd5b615d18915060c03d60c011615d20575b615d1081836106a5565b810190615ba7565b90505f615cbf565b503d615d06565b604051630e282ec960e21b8152600490fd5b60405163a6226f8560e01b8152600490fd5b604051631754d7a960e01b8152600490fd5b908160209103126104a95761079c90615b92565b9060418151145f14615d995761149c91602082015190606060408401519301515f1a90615fd7565b50505f90600290565b60405163095ea7b360e01b602082018181526001600160a01b0385166024840152604480840196909652948252939092601f1991615de16064866106a5565b5f806001600160a01b0386169287519082855af190615dfe61376c565b82615e68575b5081615e5d575b5015615e18575050505050565b60405160208101959095526001600160a01b031660248501525f6044850152615e5393614cd691615e4d908260648101612356565b826154dc565b5f808080806150ee565b90503b15155f615e0b565b80519192508115918215615e80575b5050905f615e04565b615e9392506020809183010191016154c7565b5f80615e77565b6044919260206001600160a01b0360405194858092636eb1769f60e11b8252306004830152808916602483015286165afa928315610a0e575f93615f1d575b5082018092116137bc5760405163095ea7b360e01b60208201526001600160a01b03909316602484015260448301919091526105a69190614cd68260648101614cc8565b615f3791935060203d602011610f2c57610f1d81836106a5565b915f615ed9565b91929015615fa05750815115615f52575090565b3b15615f5b5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015615fb35750805190602001fd5b60405162461bcd60e51b8152602060048201529081906114399060248301906114a0565b7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411616047576020935f9360ff60809460405194855216868401526040830152606082015282805260015afa15610a0e575f516001600160a01b0381161561603f57905f90565b505f90600190565b505050505f9060039056fea36474726f6e58221220a4dabdfed08e9a453c321e2089930d5997867b095242a34fce8ef94c8e7c51326c6578706572696d656e74616cf564736f6c6343000819004100000000000000000000000000000000000000000000000000000000000151800000000000000000000000007a37257e14a52d3bc92d923cbc3f553bda3c77c90000000000000000000000001ace3bbd69b63063f859514eca29c9bdd8310e61000000000000000000000000891cdb91d149f23b1a45d9c5ca78a88d0cb44c180000000000000000000000000000000000000000000000000000000000000e1000000000000000000000000000000000000000000000000000000000000054600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x4be681", + "transactionHash": "dd6c4a519ebd1ae4cb184450c83ecadaf313104f3e999300d13d20e968939cfb", + "blockHash": null, + "blockNumber": "0x4d80ca8", + "gasUsed": "0x4be681", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TKBGZJFbCnrCjwuRu16ytoYTEzruCDP5sR" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774470900117, + "chain": 728126428 +} diff --git a/broadcast/deployed-addresses.json b/broadcast/deployed-addresses.json index f3aaba2a2..2f16aff5e 100644 --- a/broadcast/deployed-addresses.json +++ b/broadcast/deployed-addresses.json @@ -1097,6 +1097,26 @@ } } }, + "728126428": { + "chain_name": "Chain 728126428", + "contracts": { + "SP1AutoVerifier": { + "address": "TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84", + "block_number": 81235137, + "transaction_hash": "6bb786350fb65c85df414085b65caa22e5de47d59a241ec4b213aae2b41a9738" + }, + "SP1Helios": { + "address": "TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx", + "block_number": 81266543, + "transaction_hash": "2a282124875b409051659cb86e82d2e6ae7eaa16df3d1a801b0936a2ffae81e9" + }, + "SpokePool": { + "address": "TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8", + "block_number": 81267900, + "transaction_hash": "916d12109b908916a5180dbaf032c577b758615e975ce909cdee696f066f5ac9" + } + } + }, "133268194659241": { "chain_name": "Solana Devnet", "contracts": { diff --git a/broadcast/deployed-addresses.md b/broadcast/deployed-addresses.md index cba152127..245994b09 100644 --- a/broadcast/deployed-addresses.md +++ b/broadcast/deployed-addresses.md @@ -407,6 +407,14 @@ This file contains the latest deployed smart contract addresses from the broadca | MulticallHandler | [0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E](https://sepolia.blastscan.io/address/0x0F7Ae28dE1C8532170AD4ee566B5801485c13a0E) | | SpokePool | [0x5545092553Cf5Bf786e87a87192E902D50D8f022](https://sepolia.blastscan.io/address/0x5545092553Cf5Bf786e87a87192E902D50D8f022) | +## Chain 728126428 (728126428) + +| Contract Name | Address | +| --------------- | ---------------------------------- | +| SP1AutoVerifier | TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84 | +| SP1Helios | TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx | +| SpokePool | TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8 | + ## Solana Devnet (133268194659241) | Contract Name | Address | diff --git a/contracts/tron/TronImports.sol b/contracts/tron/TronImports.sol index 0a7a3d77b..e78c79cb7 100644 --- a/contracts/tron/TronImports.sol +++ b/contracts/tron/TronImports.sol @@ -6,3 +6,4 @@ pragma solidity ^0.8.0; import "../sp1-helios/SP1Helios.sol"; import "../sp1-helios/SP1AutoVerifier.sol"; import "../Universal_SpokePool.sol"; +import "@openzeppelin/contracts-v4/proxy/ERC1967/ERC1967Proxy.sol"; diff --git a/foundry.toml b/foundry.toml index aac18001a..cfb53efcc 100644 --- a/foundry.toml +++ b/foundry.toml @@ -86,5 +86,6 @@ test = "test/evm/foundry/tron" script = "script/universal/tron" cache_path = "cache-foundry-tron" out = "out-tron" +revert_strings = "default" # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/script/universal/tron/deploy.ts b/script/universal/tron/deploy.ts index 922e603c4..f8778e17b 100644 --- a/script/universal/tron/deploy.ts +++ b/script/universal/tron/deploy.ts @@ -164,6 +164,9 @@ export async function deployContract(opts: { chainId: string; artifactPath: string; encodedArgs?: string; + feeLimit?: number; + /** Override the contract name used in the broadcast artifact (default: derived from artifact filename). */ + contractNameOverride?: string; }): Promise { const { chainId, artifactPath, encodedArgs } = opts; @@ -184,7 +187,7 @@ export async function deployContract(opts: { process.exit(1); } - const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "1500000000", 10); + const feeLimit = opts.feeLimit ?? parseInt(process.env.TRON_FEE_LIMIT || "1500000000", 10); // Create a TronWeb instance (private key set below after mnemonic derivation). const tronWeb = new TronWeb({ fullHost: fullNode }); @@ -221,8 +224,9 @@ export async function deployContract(opts: { process.exit(1); } - // Extract contract name from artifact filename (e.g. "SP1Helios" from ".../SP1Helios.json"). - const contractName = path.basename(artifactPath, ".json"); + // Extract contract name from artifact filename (e.g. "SP1Helios" from ".../SP1Helios.json"), + // unless overridden by the caller. + const contractName = opts.contractNameOverride ?? path.basename(artifactPath, ".json"); // Strip 0x prefix from encoded args if provided (TronWeb expects raw hex). let parameter: string | undefined; diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/universal/tron/tron-deploy-universal-spokepool.ts index 6da658af6..028f78ae1 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/universal/tron/tron-deploy-universal-spokepool.ts @@ -2,21 +2,20 @@ /** * Deploys Universal_SpokePool to Tron via TronWeb. * - * This deploys the implementation contract only — it must be wrapped in a UUPS proxy - * and initialized separately. + * Deploys the implementation contract and wraps it in a UUPS ERC1967Proxy, + * matching the behavior of DeployUniversalSpokePool.s.sol. * * Env vars: * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) * NODE_URL_728126428 — Tron mainnet full node URL * NODE_URL_3448148188 — Tron Nile testnet full node URL * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) - * USP_HELIOS_ADDRESS — SP1Helios contract address (Tron Base58Check, T...) * * Options: * --testnet — deploy to Tron Nile testnet (default: mainnet) * * Usage: - * yarn tron-deploy-universal-spokepool [--testnet] + * yarn tron-deploy-universal-spokepool [--testnet] */ import "dotenv/config"; @@ -33,9 +32,20 @@ function readConstants(): any { return JSON.parse(fs.readFileSync(constantsPath, "utf-8")); } +/** Read deployed-addresses.json and return the HubPool address for the hub chain. */ +function getHubPoolAddress(hubChainId: string): string { + const jsonPath = path.resolve(__dirname, "../../../broadcast/deployed-addresses.json"); + const data = JSON.parse(fs.readFileSync(jsonPath, "utf-8")); + const address = data.chains?.[hubChainId]?.contracts?.HubPool?.address; + if (!address) { + console.log(`Error: HubPool not found in deployed-addresses.json for chain ${hubChainId}`); + process.exit(1); + } + return address; +} + /** Read the HubPoolStore address from generated/constants.json, matching the Solidity deploy script logic. */ -function getHubPoolStoreAddress(constants: any, spokeChainId: string): string { - const hubChainId = spokeChainId === TRON_TESTNET_CHAIN_ID ? "11155111" : "1"; +function getHubPoolStoreAddress(constants: any, hubChainId: string): string { const address = constants.L1_ADDRESS_MAP?.[hubChainId]?.hubPoolStore; if (!address) { console.log(`Error: hubPoolStore not found in constants.json for hub chain ${hubChainId}`); @@ -44,26 +54,27 @@ function getHubPoolStoreAddress(constants: any, spokeChainId: string): string { return address; } -function requireEnv(name: string): string { - const value = process.env[name]; - if (!value) { - console.log(`Error: ${name} env var is required.`); +async function main(): Promise { + // First positional arg (skip flags like --testnet) + const sp1HeliosAddress = process.argv.slice(2).find((a) => !a.startsWith("-")); + if (!sp1HeliosAddress) { + console.log("Usage: yarn tron-deploy-universal-spokepool [--testnet]"); process.exit(1); } - return value; -} -async function main(): Promise { const chainId = resolveChainId(); + const hubChainId = chainId === TRON_TESTNET_CHAIN_ID ? "11155111" : "1"; console.log("=== Universal_SpokePool Tron Deployment ==="); console.log(`Chain ID: ${chainId}`); + console.log(`Hub Chain ID: ${hubChainId}`); const constants = readConstants(); const adminUpdateBuffer = 86400; // 1 day, matching DeployUniversalSpokePool.s.sol - const heliosAddress = tronToEvmAddress(requireEnv("USP_HELIOS_ADDRESS")); - const hubPoolStoreAddress = getHubPoolStoreAddress(constants, chainId); + const heliosAddress = tronToEvmAddress(sp1HeliosAddress); + const hubPoolStoreAddress = getHubPoolStoreAddress(constants, hubChainId); + const hubPoolAddress = getHubPoolAddress(hubChainId); const wrappedNativeToken = tronToEvmAddress(WTRX_ADDRESS); const depositQuoteTimeBuffer = constants.TIME_CONSTANTS.QUOTE_TIME_BUFFER; const fillDeadlineBuffer = constants.TIME_CONSTANTS.FILL_DEADLINE_BUFFER; @@ -77,6 +88,7 @@ async function main(): Promise { console.log(` Admin update buffer: ${adminUpdateBuffer}s`); console.log(` Helios: ${heliosAddress}`); console.log(` HubPoolStore: ${hubPoolStoreAddress}`); + console.log(` HubPool: ${hubPoolAddress}`); console.log(` Wrapped native token: ${wrappedNativeToken}`); console.log(` Deposit quote buffer: ${depositQuoteTimeBuffer}s`); console.log(` Fill deadline buffer: ${fillDeadlineBuffer}s`); @@ -85,8 +97,9 @@ async function main(): Promise { console.log(` OFT dst EID: ${oftDstEid} (disabled — OFT not supported on Tron)`); console.log(` OFT fee cap: ${oftFeeCap} (disabled)`); - // Constructor: (uint256, address, address, address, uint32, uint32, IERC20, ITokenMessenger, uint32, uint256) - const encodedArgs = encodeArgs( + // Step 1: Deploy implementation contract + console.log("\n--- Deploying implementation ---"); + const implEncodedArgs = encodeArgs( ["uint256", "address", "address", "address", "uint32", "uint32", "address", "address", "uint32", "uint256"], [ adminUpdateBuffer, @@ -102,9 +115,52 @@ async function main(): Promise { ] ); - const artifactPath = path.resolve(__dirname, "../../../out-tron/Universal_SpokePool.sol/Universal_SpokePool.json"); + const implArtifactPath = path.resolve( + __dirname, + "../../../out-tron/Universal_SpokePool.sol/Universal_SpokePool.json" + ); + + const implResult = await deployContract({ + chainId, + artifactPath: implArtifactPath, + encodedArgs: implEncodedArgs, + }); + + console.log(`\nImplementation deployed: ${implResult.address}`); + + // Step 2: Deploy ERC1967Proxy pointing to the implementation, with initialize calldata. + // Matches DeployUniversalSpokePool.s.sol: initialize(1, hubPool, hubPool) + console.log("\n--- Deploying ERC1967Proxy ---"); + + // Universal_SpokePool.initialize(uint32 _initialDepositId, address _crossDomainAdmin, address _withdrawalRecipient) + // selector: initialize(uint32,address,address) + const initCalldata = encodeArgs(["uint32", "address", "address"], [1, hubPoolAddress, hubPoolAddress]); + + // Compute the full initialize calldata with function selector. + // initialize(uint32,address,address) selector = 0x1794bb3c — but let's compute it properly. + // We need abi.encodeWithSelector, which is selector + args. + // The initialize function signature from Universal_SpokePool: + // function initialize(uint32 _initialDepositId, address _crossDomainAdmin, address _withdrawalRecipient) + const { TronWeb } = await import("tronweb"); + const twUtil = new TronWeb({ fullHost: "http://localhost" }); + const initSelector = twUtil.sha3("initialize(uint32,address,address)").slice(0, 10); // 0x + 8 hex chars + // initCalldata from encodeArgs starts with 0x, strip it to concat with selector + const initData = initSelector + initCalldata.slice(2); + + // ERC1967Proxy constructor: (address _logic, bytes memory _data) + const proxyEncodedArgs = encodeArgs(["address", "bytes"], [tronToEvmAddress(implResult.address), initData]); + + const proxyArtifactPath = path.resolve(__dirname, "../../../out-tron/ERC1967Proxy.sol/ERC1967Proxy.json"); + + const proxyResult = await deployContract({ + chainId, + artifactPath: proxyArtifactPath, + encodedArgs: proxyEncodedArgs, + contractNameOverride: "SpokePool", + }); - await deployContract({ chainId, artifactPath, encodedArgs }); + console.log(`\nProxy deployed: ${proxyResult.address}`); + console.log(`Implementation: ${implResult.address}`); } main().catch((err) => { From d00da9300847ac6888aca8ada72e3462d3ac5822 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Wed, 25 Mar 2026 17:36:07 -0600 Subject: [PATCH 12/19] bring in counterfactual scripts & deploy --- .gitignore | 4 +- .../728126428/run-latest.json | 38 ++++ .../728126428/run-latest.json | 38 ++++ .../728126428/run-latest.json | 42 ++++ .../728126428/run-latest.json | 38 ++++ broadcast/deployed-addresses.json | 20 ++ broadcast/deployed-addresses.md | 14 +- foundry.toml | 2 +- package.json | 11 +- script/{universal => }/tron/README.md | 92 +++++--- .../tron-deploy-counterfactual-clone.ts | 197 ++++++++++++++++++ ...deploy-counterfactual-deposit-spokepool.ts | 62 ++++++ .../tron-deploy-counterfactual-deposit.ts | 35 ++++ .../tron-deploy-counterfactual-factory.ts | 33 +++ .../tron-deploy-withdraw-implementation.ts | 33 +++ script/{universal => }/tron/deploy.ts | 2 +- .../tron-deploy-sp1-auto-verifier.ts | 2 +- .../universal}/tron-deploy-sp1-helios.ts | 4 +- .../tron-deploy-universal-spokepool.ts | 2 +- 19 files changed, 625 insertions(+), 44 deletions(-) create mode 100644 broadcast/TronDeployCounterfactualDeposit.s.sol/728126428/run-latest.json create mode 100644 broadcast/TronDeployCounterfactualDepositFactoryTron.s.sol/728126428/run-latest.json create mode 100644 broadcast/TronDeployCounterfactualDepositSpokePool.s.sol/728126428/run-latest.json create mode 100644 broadcast/TronDeployWithdrawImplementation.s.sol/728126428/run-latest.json rename script/{universal => }/tron/README.md (53%) create mode 100644 script/tron/counterfactual/tron-deploy-counterfactual-clone.ts create mode 100644 script/tron/counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts create mode 100644 script/tron/counterfactual/tron-deploy-counterfactual-deposit.ts create mode 100644 script/tron/counterfactual/tron-deploy-counterfactual-factory.ts create mode 100644 script/tron/counterfactual/tron-deploy-withdraw-implementation.ts rename script/{universal => }/tron/deploy.ts (99%) rename script/{universal/tron => tron/universal}/tron-deploy-sp1-auto-verifier.ts (94%) rename script/{universal/tron => tron/universal}/tron-deploy-sp1-helios.ts (98%) rename script/{universal/tron => tron/universal}/tron-deploy-universal-spokepool.ts (99%) diff --git a/.gitignore b/.gitignore index c1f3dc3a6..66244e2af 100644 --- a/.gitignore +++ b/.gitignore @@ -57,8 +57,8 @@ src/svm/clients/* # SP1Helios deploy artifacts script/universal/genesis-binary script/universal/genesis.json -script/universal/tron/genesis-binary -script/universal/tron/genesis.json +script/tron/universal/genesis-binary +script/tron/universal/genesis.json # Tron solc binary and flattened sources bin/solc-tron diff --git a/broadcast/TronDeployCounterfactualDeposit.s.sol/728126428/run-latest.json b/broadcast/TronDeployCounterfactualDeposit.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..53e01bc41 --- /dev/null +++ b/broadcast/TronDeployCounterfactualDeposit.s.sol/728126428/run-latest.json @@ -0,0 +1,38 @@ +{ + "transactions": [ + { + "hash": "715d4b3c1dfdd0d7bd754c928ad812da1de4663502923d8bed79164ce047717e", + "transactionType": "CREATE", + "contractName": "CounterfactualDeposit", + "contractAddress": "TUE4j3wvnJf5Qwo9ZdYS9XebFzbMMvisEy", + "function": null, + "arguments": null, + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x60808060405234601d57d3601d57d2601d576104a390816100228239f35b5f80fdfe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c6398b937930361000e5760803660031901126100e75760043574ffffffffffffffffffffffffffffffffffffffffff811681036100e75767ffffffffffffffff6024358181116100e7576100779036906004016100eb565b6044939193358381116100e7576100929036906004016100eb565b91606435958587116100e757366023880112156100e75786600401359586116100e7573660248760051b890101116100e75773ffffffffffffffffffffffffffffffffffffffff6024610018980195166102af565b5f80fd5b9181601f840112156100e75782359167ffffffffffffffff83116100e757602083818601950101116100e757565b908160209103126100e7575190565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761015e57604052565b610128565b67ffffffffffffffff811161015e57601f01601f191660200190565b92919261018b82610163565b91610199604051938461013c565b8294818452818301116100e7578281602093845f960137010152565b90604051916020830152602082526040820182811067ffffffffffffffff82111761015e57604052565b90929167ffffffffffffffff841161015e578360051b60209260206040516102098285018261013c565b80978152019181019283116100e757905b8282106102275750505050565b8135815290830190830161021a565b908060209392818452848401375f828201840152601f01601f1916010190565b929061026f9061027d9593604086526040860191610236565b926020818503910152610236565b90565b3d156102aa573d9061029182610163565b9161029f604051938461013c565b82523d5f602084013e565b606090565b92909193306102bd906103b9565b8051602098916102d39181018a01908a01610119565b906102df36888761017f565b8051908a01206040805173ffffffffffffffffffffffffffffffffffffffff8916818d019081526020808201949094528181039384018252601f199b93909261032991018261013c565b519020610335906101b5565b8a8151910120913690610347926101df565b9161035192610413565b156103a7575f95869561037e61038a936040519586938c850198631f6a1eb960e01b8a5260248601610256565b0390810183528261013c565b51915af490610397610280565b91156103a1575050565b81519101fd5b6040516309bde33960e01b8152600490fd5b803b90602c1982019182116103ff57602d6103ec6103d684610163565b936103e4604051958661013c565b808552610163565b6020840190601f19013682378351923c90565b634e487b7160e01b5f52601160045260245ffd5b9091905f915b8151831015610458576020808460051b84010151918281105f14610449575f5252600160405f205b920191610419565b915f5252600160405f20610441565b915050149056fea36474726f6e58221220ab54cc40f54b3793c257a467a29e76e9888b68c75cc3ae30bd9520600ac8bc626c6578706572696d656e74616cf564736f6c63430008190041", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x3a091", + "transactionHash": "715d4b3c1dfdd0d7bd754c928ad812da1de4663502923d8bed79164ce047717e", + "blockHash": null, + "blockNumber": "0x4d818b6", + "gasUsed": "0x3a091", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TUE4j3wvnJf5Qwo9ZdYS9XebFzbMMvisEy" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774480156811, + "chain": 728126428 +} diff --git a/broadcast/TronDeployCounterfactualDepositFactoryTron.s.sol/728126428/run-latest.json b/broadcast/TronDeployCounterfactualDepositFactoryTron.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..8e7b5b015 --- /dev/null +++ b/broadcast/TronDeployCounterfactualDepositFactoryTron.s.sol/728126428/run-latest.json @@ -0,0 +1,38 @@ +{ + "transactions": [ + { + "hash": "ac7736e4912d3bd8e02b9dc26bd0ba6c0486b488b091141a8dde7f0c96be13f5", + "transactionType": "CREATE", + "contractName": "CounterfactualDepositFactoryTron", + "contractAddress": "TTLJiJFju5Qi3tmnZNx7Bxrk753p4AMjob", + "function": null, + "arguments": null, + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x60808060405234601d57d3601d57d2601d5761056690816100228239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c80630f6a7569146100645780631cff79cd1461005f578063655fe4421461005a57806370217fcc146100555763e3b95ea414610050575f80fd5b610236565b610214565b6101d2565b61010b565b3461009857d361009857d26100985760206100876100813661009c565b916102b0565b6001600160a01b0360405191168152f35b5f80fd5b60609060031901126100985760043574ffffffffffffffffffffffffffffffffffffffffff81168103610098576001600160a01b0316906024359060443590565b9181601f840112156100985782359167ffffffffffffffff8311610098576020838186019501011161009857565b60403660031901126100985760043574ffffffffffffffffffffffffffffffffffffffffff811681036100985760243567ffffffffffffffff81116100985761016d916101646001600160a01b039236906004016100dd565b92909116610419565b005b9060806003198301126100985760043574ffffffffffffffffffffffffffffffffffffffffff81168103610098576001600160a01b03169160243591604435916064359067ffffffffffffffff8211610098576101ce916004016100dd565b9091565b60206100876101e03661016f565b92949390916101f08187846103ac565b95863b15610202575b50505083610419565b61020b926102b0565b505f80806101f9565b602061022f6100876102253661016f565b93959290956102b0565b9283610419565b3461009857d361009857d26100985760206100876102533661009c565b916103ac565b634e487b7160e01b5f52604160045260245ffd5b6040810190811067ffffffffffffffff82111761028957604052565b610259565b90601f8019910116810190811067ffffffffffffffff82111761028957604052565b92916040938451836020820152602081526102ca8161026d565b615fd381511161039b57805190602d82018092116103875761030c6102fe9188519283918661ffff60208501971687610482565b03601f19810183528261028e565b805115610376575183915ff56001600160a01b0380821692831561035b579651938452909516917ff0bde019f3a046b26742c83cb12027f36f44d67a9e176669724b88c848ff242b90602090a4565b873d610371575163b06ebf3d60e01b8152600490fd5b610517565b8651631328927760e21b8152600490fd5b634e487b7160e01b5f52601160045260245ffd5b855163250a241560e21b8152600490fd5b604051916020830152602082526103c28261026d565b815192602d8401809411610387576001600160a01b03936055936103fa600b946102fe60405193849261ffff60208501971687610482565b5190209060405191604083015260208201523081520160418153201690565b5f9283928160405192839283378101848152039134905af13d1561047a573d9067ffffffffffffffff82116102895760405191610460601f8201601f19166020018461028e565b82523d5f602084013e5b156104725750565b602081519101fd5b60609061046a565b9092602092603794606160f81b845261ffff60f01b9060f01b1660018401527f3d81600a3d39f3363d3d373d3d3d363d7300000000000000000000000000000060038401526bffffffffffffffffffffffff199060601b1660148301527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288301528051928391018483015e01015f815290565b6040513d5f823e3d90fdfea36474726f6e58221220e350ecd782bc2b476c93185e4b3062e78ff66404954f1f04ba839fbdbb4ce41f6c6578706572696d656e74616cf564736f6c63430008190041", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x4390e", + "transactionHash": "ac7736e4912d3bd8e02b9dc26bd0ba6c0486b488b091141a8dde7f0c96be13f5", + "blockHash": null, + "blockNumber": "0x4d81496", + "gasUsed": "0x4390e", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TTLJiJFju5Qi3tmnZNx7Bxrk753p4AMjob" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774476990567, + "chain": 728126428 +} diff --git a/broadcast/TronDeployCounterfactualDepositSpokePool.s.sol/728126428/run-latest.json b/broadcast/TronDeployCounterfactualDepositSpokePool.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..323f4c7ec --- /dev/null +++ b/broadcast/TronDeployCounterfactualDepositSpokePool.s.sol/728126428/run-latest.json @@ -0,0 +1,42 @@ +{ + "transactions": [ + { + "hash": "d3a41d6aaf79a3a482c3824050ecd44457957b920893d92da222a2335eefdd09", + "transactionType": "CREATE", + "contractName": "CounterfactualDepositSpokePool", + "contractAddress": "TN3K7Tk2jZMjdafcUQrkg8yw6BneQtXZ75", + "function": null, + "arguments": [ + "TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8", + "TWBR6NQ9djgGnxnnzu7YMn7FFGmvLtRZsx", + "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR" + ], + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x6101c03461020d57d361020d57d261020d57601f6116b538819003918201601f19168301926001600160401b03929091838511838610176101f957816060928492604097885283398101031261020d576100588161022c565b90610070846100696020840161022c565b920161022c565b91845161007c81610211565b601e8152602081017f436f756e7465726661637475616c4465706f73697453706f6b65506f6f6c0000815286516100b281610211565b600681526020810165076312e302e360d41b81526100cf84610249565b926101209384526100df836103e0565b94610140958652519020918260e05251902061010098818a524660a05280519160208301937f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f85528284015260608301524660808301523060a083015260a0825260c0820198828a10908a11176101f9578890525190206080523060c0526101609283526101809384526101a094855261119e9687610517883960805187610f29015260a05187610ff5015260c05187610efa015260e05187610f7801525186610f9e015251856101150152518461013f01525183818160d1015281816106e601528181610782015281816109ac01528181610a0e0152610a6d01525182818161024a015261057101525181818161065e0152610b760152f35b634e487b7160e01b5f52604160045260245ffd5b5f80fd5b604081019081106001600160401b038211176101f957604052565b516001600160a81b038116810361020d576001600160a01b031690565b8051602090818110156102bf5750601f825111610281578082519201519080831061027357501790565b825f19910360031b1b161790565b60448260405192839163305a27a960e01b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fd5b906001600160401b0382116101f9575f54926001938481811c911680156103d6575b838210146103c257601f811161038f575b5081601f841160011461032d57509282939183925f94610322575b50501b915f199060031b1c1916175f5560ff90565b015192505f8061030d565b919083601f1981165f8052845f20945f905b88838310610375575050501061035d575b505050811b015f5560ff90565b01515f1960f88460031b161c191690555f8080610350565b85870151885590960195948501948793509081019061033f565b5f805284601f845f20920160051c820191601f860160051c015b8281106103b75750506102f2565b5f81550185906103a9565b634e487b7160e01b5f52602260045260245ffd5b90607f16906102e1565b80516020908181101561040a5750601f825111610281578082519201519080831061027357501790565b9192916001600160401b0381116101f95760019182548381811c9116801561050c575b828210146103c257601f81116104d9575b5080601f83116001146104795750819293945f9261046e575b50505f19600383901b1c191690821b17905560ff90565b015190505f80610457565b90601f19831695845f52825f20925f905b8882106104c257505083859697106104aa575b505050811b01905560ff90565b01515f1960f88460031b161c191690555f808061049d565b80878596829496860151815501950193019061048a565b835f5283601f835f20920160051c820191601f850160051c015b82811061050157505061043e565b5f81550184906104f3565b90607f169061042d56fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816317fcb39b14610b4f575080631f6a1eb91461026e578063238ac9331461022057806384b0196e146100f5578063afdac3d6146100a75763e1a83fbc14610060575f80fd5b346100a457d36100a457d26100a457806003193601126100a45760206040517fd416bae1dfdb418110a17f2312d6adefdc0e80f7ebeda031c533b45fee7f605e8152f35b80fd5b50346100a457d36100a457d26100a457806003193601126100a45760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346100a457d36100a457d26100a457806003193601126100a4576101397f0000000000000000000000000000000000000000000000000000000000000000610cfb565b906101637f0000000000000000000000000000000000000000000000000000000000000000610e1f565b9060405190602090602083019383851067ffffffffffffffff86111761020c5792849260206101c288966101b498604052858552604051988998600f60f81b8a5260e0858b015260e08a0190610bc8565b9088820360408a0152610bc8565b924660608801523060808801528460a088015286840360c088015251928381520193925b8281106101f557505050500390f35b8351855286955093810193928101926001016101e6565b634e487b7160e01b5f52604160045260245ffd5b50346100a457d36100a457d26100a457806003193601126100a45760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b5060403660031901126109805760043567ffffffffffffffff81116109805761029b903690600401610b9a565b9060243567ffffffffffffffff8111610980576102bc903690600401610b9a565b9092602083828101031261098057823567ffffffffffffffff811161098057610120818501838601031261098057604051936102f785610bec565b8082018035865260208082013590870152604080820135908701526060808201359087015267ffffffffffffffff608090910135116109805761010092610348908201838301608081013501610c63565b60808601520160a0818101359085015260c0808201359085015260e0808201359085015201356101008301526020818401849003126109805782359267ffffffffffffffff841161098057610120848201838301031261098057604051936103af85610bec565b8181018035865260208082013590870152604080820135908701526103d690606001610ca9565b60608601528181016080013574ffffffffffffffffffffffffffffffffffffffffff81169003610980576001600160a01b036080828401013516608086015261042360a082840101610ca9565b60a086015261043660c082840101610ca9565b60c086015261044960e082840101610ca9565b60e086015261010081830101359067ffffffffffffffff821161098057610474938301920101610c63565b61010083015263ffffffff60e0830151164211610b3d5761056661055d604284516020860151604087015163ffffffff60608901511663ffffffff60a08a0151169063ffffffff60c08b0151169263ffffffff60e08c01511694604051967fd416bae1dfdb418110a17f2312d6adefdc0e80f7ebeda031c533b45fee7f605e602089015260408801526060870152608086015260a085015260c084015260e0830152610100820152610100815261052a81610bec565b60208151910120610539610ef0565b906040519161190160f01b835260028301526022820152206101008501519061101b565b90929192611055565b6001600160a01b03807f000000000000000000000000000000000000000000000000000000000000000016911603610b2b576001600160a01b036020820151166105b7835161010084015190610cba565b8351670de0b6b3a76400006105d5602087015160a087015190610cdb565b0480831115610b1e576105fa6105ee6106189285610cba565b61010087015190610cee565b9161271061061160c08801519260e0890151610cdb565b0490610cee565b10610b0c5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8203610995575b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee820361098b576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee83036109845781905b60608501519160408601519160208801519387519460408a015163ffffffff60a08c0151168b63ffffffff60608160c084015116920151169160808d0151936001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b15610980575f9a610776966040519d8e9c8d9b8c9b6356aa12e360e11b8d528c60043091015260248d015260448c015260648b015260848a015260a489015260c488015260e4870152610104860152610124850152610144840152610180610164840152610184830190610bc8565b03916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af1801561097557610956575b506101008201518492918161084e575b838580517f0dbe492f34744f479f266d44e653e9cf44008fd310e4d2870a195f14fd81f43960c060208401519260408501519363ffffffff606087015116956001600160a01b036080820151169663ffffffff60a0830151169063ffffffff60e08188860151169401511693604051958652602086015260408501526060840152608083015260a0820152a380f35b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81036108d4575050818080926101006001600160a01b03608088015116910151905af13d156108cf573d61089681610c47565b906108a46040519283610c25565b81528360203d92013e5b156108bd575b815f80806107bf565b604051633d2cec6f60e21b8152600490fd5b6108ae565b915091506001600160a01b03608084015116916040519263a9059cbb60e01b865260045260245260208460448180855af16001855114811615610937575b82604052156109225750506108b4565b635274afe760e01b8252600482015260249150fd5b600181151661094d57813b15153d151616610912565b823d86823e3d90fd5b9091935067ffffffffffffffff811161020c576040525f92905f6107af565b6040513d5f823e3d90fd5b5f80fd5b5f9061069d565b602083015161067f565b60405163095ea7b360e01b5f526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166004528160245260205f60448180875af160015f5114811615610aff575b81604052156109fa575b50610639565b63095ea7b360e01b5f526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166004525f60245260205f60448180875af160015f5114811615610ae9575b8160405215610ab4575060405163095ea7b360e01b5f526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166004528160245260205f60448180875af160015f5114811615610aca575b816040526109f4575b635274afe760e01b815260048101839052602490fd5b6001811516610ae057833b15153d151616610aab565b503d5f823e3d90fd5b6001811516610ae057833b15153d151616610a4c565b833b15153d1516166109ea565b60405163e3ca8ad560e01b8152600490fd5b506106186105fa5f6105ee565b604051638baa579f60e01b8152600490fd5b604051630819bdcd60e01b8152600490fd5b3461098057d361098057d2610980575f366003190112610980576020906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b9181601f840112156109805782359167ffffffffffffffff8311610980576020838186019501011161098057565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b610120810190811067ffffffffffffffff82111761020c57604052565b6040810190811067ffffffffffffffff82111761020c57604052565b90601f8019910116810190811067ffffffffffffffff82111761020c57604052565b67ffffffffffffffff811161020c57601f01601f191660200190565b81601f8201121561098057803590610c7a82610c47565b92610c886040519485610c25565b8284526020838301011161098057815f926020809301838601378301015290565b359063ffffffff8216820361098057565b91908203918211610cc757565b634e487b7160e01b5f52601160045260245ffd5b81810292918115918404141715610cc757565b91908201809211610cc757565b60ff8114610d395760ff811690601f8211610d275760405191610d1d83610c09565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b506040515f8054906001908260011c60018416928315610e15575b6020948583108514610e01578287528694908115610de15750600114610d86575b5050610d8392500382610c25565b90565b5f8080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56395935091905b818310610dc9575050610d8393508201015f80610d75565b85548784018501529485019486945091830191610db1565b915050610d8394925060ff191682840152151560051b8201015f80610d75565b634e487b7160e01b5f52602260045260245ffd5b90607f1690610d54565b60ff8114610e415760ff811690601f8211610d275760405191610d1d83610c09565b506040515f60018054918260011c60018416928315610ee6575b6020948583108514610e01578287528694908115610de15750600114610e89575050610d8392500382610c25565b9093915060015f527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6935f915b818310610ece575050610d8393508201015f80610d75565b85548784018501529485019486945091830191610eb6565b90607f1690610e5b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016301480610ff2575b15610f4b577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff82111761020c5760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614610f22565b815191906041830361104b576110449250602082015190606060408401519301515f1a906110d8565b9192909190565b50505f9160029190565b60048110156110c45780611067575050565b600181036110815760405163f645eedf60e01b8152600490fd5b600281036110a25760405163fce698f760e01b815260048101839052602490fd5b6003146110ac5750565b602490604051906335e2f38360e21b82526004820152fd5b634e487b7160e01b5f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841161114f579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610975575f516001600160a01b0381161561114557905f905f90565b505f906001905f90565b5050505f916003919056fea36474726f6e58221220fe73d82dbf32a5572d8d37e9156ab997bdfb60f1d4a9af6ec694139f441d46a26c6578706572696d656e74616cf564736f6c63430008190041000000000000000000000000284352bb448c65b75ebe004862e4f4531042d628000000000000000000000000ddb199ca909901299adcab370c3c8212cea80afe000000000000000000000000891cdb91d149f23b1a45d9c5ca78a88d0cb44c18", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0xdcdb2", + "transactionHash": "d3a41d6aaf79a3a482c3824050ecd44457957b920893d92da222a2335eefdd09", + "blockHash": null, + "blockNumber": "0x4d81a8d", + "gasUsed": "0xdcdb2", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TN3K7Tk2jZMjdafcUQrkg8yw6BneQtXZ75" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774481569008, + "chain": 728126428 +} diff --git a/broadcast/TronDeployWithdrawImplementation.s.sol/728126428/run-latest.json b/broadcast/TronDeployWithdrawImplementation.s.sol/728126428/run-latest.json new file mode 100644 index 000000000..a9da7034b --- /dev/null +++ b/broadcast/TronDeployWithdrawImplementation.s.sol/728126428/run-latest.json @@ -0,0 +1,38 @@ +{ + "transactions": [ + { + "hash": "226499b9a0e735991922ca744364017aa882df1b33ea23e44c80695181ed12d4", + "transactionType": "CREATE", + "contractName": "WithdrawImplementation", + "contractAddress": "TJkwUDFPKXABkeu38v42sdwQS2VxgRweow", + "function": null, + "arguments": null, + "transaction": { + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "gas": "0x59682f00", + "value": "0x0", + "input": "0x60808060405234601d57d3601d57d2601d5761033d90816100228239f35b5f80fdfe608060409080825260049081361015610016575f80fd5b5f3560e01c631f6a1eb914610029575f80fd5b8260031936011261027d5767ffffffffffffffff92823584811161027d576100549036908501610293565b91602495863581811161027d5782610070859236908a01610293565b9290968101031261027d578286018681108382111761028157856100b0969798999260609286526100a0876102c1565b998a8152602098898099016102c1565b97889101528101031261027d576100c6866102c1565b93836100d38789016102c1565b9701359473ffffffffffffffffffffffffffffffffffffffff808080931699169916331415918261026f575b50506102605773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee86036101ce575f808080878b5af1913d156101c7573d908082116101b557845192601f8301601f19908116603f01168401918211848310176101a35750845281525f853d92013e5b15610194577f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb939495505b51908152a3005b51633d2cec6f60e21b81528590fd5b634e487b7160e01b5f90815260418c52fd5b8260418b634e487b7160e01b5f52525ffd5b5050610162565b96905081519063a9059cbb60e01b5f52868152838852845f604481808a5af160015f5114811615610241575b8284521561022e5750507f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb9394955061018d565b635274afe760e01b825281018590528690fd5b600181151661025757863b15153d1516166101fa565b823d5f823e3d90fd5b82516282b42960e81b81528890fd5b909150163314155f806100ff565b5f80fd5b88604189634e487b7160e01b5f52525ffd5b9181601f8401121561027d5782359167ffffffffffffffff831161027d576020838186019501011161027d57565b3574ffffffffffffffffffffffffffffffffffffffffff8116810361027d5773ffffffffffffffffffffffffffffffffffffffff169056fea36474726f6e582212201ef144fc88ad3835ec25f7331149661b1874c6744895d54a59d714893020b32b6c6578706572696d656e74616cf564736f6c63430008190041", + "chainId": "0x2b6653dc" + }, + "additionalContracts": [] + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x28897", + "transactionHash": "226499b9a0e735991922ca744364017aa882df1b33ea23e44c80695181ed12d4", + "blockHash": null, + "blockNumber": "0x4d81465", + "gasUsed": "0x28897", + "from": "TQ4T4DgHoezYBTRoZPCspsSgRw38Ni9prA", + "to": null, + "contractAddress": "TJkwUDFPKXABkeu38v42sdwQS2VxgRweow" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1774476842761, + "chain": 728126428 +} diff --git a/broadcast/deployed-addresses.json b/broadcast/deployed-addresses.json index 2f16aff5e..b8a1573cf 100644 --- a/broadcast/deployed-addresses.json +++ b/broadcast/deployed-addresses.json @@ -1100,6 +1100,21 @@ "728126428": { "chain_name": "Chain 728126428", "contracts": { + "CounterfactualDeposit": { + "address": "TUE4j3wvnJf5Qwo9ZdYS9XebFzbMMvisEy", + "block_number": 81270966, + "transaction_hash": "715d4b3c1dfdd0d7bd754c928ad812da1de4663502923d8bed79164ce047717e" + }, + "CounterfactualDepositFactoryTron": { + "address": "TTLJiJFju5Qi3tmnZNx7Bxrk753p4AMjob", + "block_number": 81269910, + "transaction_hash": "ac7736e4912d3bd8e02b9dc26bd0ba6c0486b488b091141a8dde7f0c96be13f5" + }, + "CounterfactualDepositSpokePool": { + "address": "TN3K7Tk2jZMjdafcUQrkg8yw6BneQtXZ75", + "block_number": 81271437, + "transaction_hash": "d3a41d6aaf79a3a482c3824050ecd44457957b920893d92da222a2335eefdd09" + }, "SP1AutoVerifier": { "address": "TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84", "block_number": 81235137, @@ -1114,6 +1129,11 @@ "address": "TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8", "block_number": 81267900, "transaction_hash": "916d12109b908916a5180dbaf032c577b758615e975ce909cdee696f066f5ac9" + }, + "WithdrawImplementation": { + "address": "TJkwUDFPKXABkeu38v42sdwQS2VxgRweow", + "block_number": 81269861, + "transaction_hash": "226499b9a0e735991922ca744364017aa882df1b33ea23e44c80695181ed12d4" } } }, diff --git a/broadcast/deployed-addresses.md b/broadcast/deployed-addresses.md index 245994b09..44fd59ae3 100644 --- a/broadcast/deployed-addresses.md +++ b/broadcast/deployed-addresses.md @@ -409,11 +409,15 @@ This file contains the latest deployed smart contract addresses from the broadca ## Chain 728126428 (728126428) -| Contract Name | Address | -| --------------- | ---------------------------------- | -| SP1AutoVerifier | TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84 | -| SP1Helios | TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx | -| SpokePool | TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8 | +| Contract Name | Address | +| -------------------------------- | ---------------------------------- | +| CounterfactualDeposit | TUE4j3wvnJf5Qwo9ZdYS9XebFzbMMvisEy | +| CounterfactualDepositFactoryTron | TTLJiJFju5Qi3tmnZNx7Bxrk753p4AMjob | +| CounterfactualDepositSpokePool | TN3K7Tk2jZMjdafcUQrkg8yw6BneQtXZ75 | +| SP1AutoVerifier | TUsGvWXwp8fhFfJD2Qj3qGUWUFqH4sjm84 | +| SP1Helios | TM7RW746BsRpoarBGZfwWVnVvhLNK6tBQx | +| SpokePool | TDe6gRnHcqZnhn1H5UZQcJ29kmvadFKjb8 | +| WithdrawImplementation | TJkwUDFPKXABkeu38v42sdwQS2VxgRweow | ## Solana Devnet (133268194659241) diff --git a/foundry.toml b/foundry.toml index cfb53efcc..bee71606a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -83,7 +83,7 @@ solc = "bin/solc-tron" evm_version = "cancun" src = "contracts/tron" test = "test/evm/foundry/tron" -script = "script/universal/tron" +script = "script/tron" cache_path = "cache-foundry-tron" out = "out-tron" revert_strings = "default" diff --git a/package.json b/package.json index ee9281748..d0fa44e14 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,14 @@ "extract-addresses": "./script/utils/extract_foundry_addresses.sh", "generate-constants-json": "ts-node ./script/utils/GenerateConstantsJson.ts", "build-tron": "FOUNDRY_PROFILE=tron forge build", - "tron-deploy-sp1-auto-verifier": "ts-node script/universal/tron/tron-deploy-sp1-auto-verifier.ts", - "tron-deploy-sp1-helios": "ts-node script/universal/tron/tron-deploy-sp1-helios.ts", - "tron-deploy-universal-spokepool": "ts-node script/universal/tron/tron-deploy-universal-spokepool.ts" + "tron-deploy-sp1-auto-verifier": "ts-node script/tron/universal/tron-deploy-sp1-auto-verifier.ts", + "tron-deploy-sp1-helios": "ts-node script/tron/universal/tron-deploy-sp1-helios.ts", + "tron-deploy-universal-spokepool": "ts-node script/tron/universal/tron-deploy-universal-spokepool.ts", + "tron-deploy-counterfactual-factory": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-factory.ts", + "tron-deploy-counterfactual-deposit": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-deposit.ts", + "tron-deploy-counterfactual-deposit-spokepool": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts", + "tron-deploy-withdraw-implementation": "ts-node script/tron/counterfactual/tron-deploy-withdraw-implementation.ts", + "tron-deploy-counterfactual-clone": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-clone.ts" }, "dependencies": { "@across-protocol/constants": "^3.1.100", diff --git a/script/universal/tron/README.md b/script/tron/README.md similarity index 53% rename from script/universal/tron/README.md rename to script/tron/README.md index a777900fe..b45dab3ef 100644 --- a/script/universal/tron/README.md +++ b/script/tron/README.md @@ -52,17 +52,18 @@ TRON_FEE_LIMIT=1500000000 # Fee limit in sun (default: 1500 TRX) > **Important:** Use the base TronGrid URL (`https://api.trongrid.io`), NOT the `/jsonrpc` endpoint. TronWeb needs the native Tron API, not the Ethereum-compatible JSON-RPC endpoint. -## Deploy Scripts +## Flags + +All scripts default to **Tron mainnet** (`728126428`). Pass `--testnet` to deploy to Nile testnet (`3448148188`). All address arguments use **Tron Base58Check format** (`T...`). + +## Universal SpokePool Scripts ### SP1AutoVerifier No-op verifier for testing SP1Helios without real ZK proofs. No constructor args. ```bash -yarn tron-deploy-sp1-auto-verifier - -# Example: deploy to Nile testnet -yarn tron-deploy-sp1-auto-verifier 3448148188 +yarn tron-deploy-sp1-auto-verifier [--testnet] ``` ### SP1Helios @@ -81,49 +82,70 @@ SP1_CONSENSUS_RPCS_LIST_TRON=https://... # Comma-separated beacon chai ``` ```bash -yarn tron-deploy-sp1-helios +yarn tron-deploy-sp1-helios [--testnet] [--fee-limit ] ``` > **Warning:** Once SP1Helios is deployed, you have 7 days to deploy the Universal_SpokePool and activate it in-protocol. After 7 days with no update, the contract becomes immutable. ### Universal_SpokePool -Deploys the implementation contract (not the proxy). Must be wrapped in a UUPS proxy and initialized separately. +Deploys the implementation contract and wraps it in a UUPS ERC1967Proxy, matching the behavior of `DeployUniversalSpokePool.s.sol`. Constructor params like wrapped native token (WTRX), time buffers, and HubPoolStore address are read from `generated/constants.json` and `broadcast/deployed-addresses.json`. -Additional env vars: +```bash +yarn tron-deploy-universal-spokepool [--testnet] +``` + +### Universal deployment order + +1. **SP1AutoVerifier** (testnet only) or wait for Succinct to deploy the real Groth16 verifier +2. **SP1Helios** — needs the verifier address +3. **Universal_SpokePool** — needs the SP1Helios address + +## Counterfactual Deposit Scripts + +### CounterfactualDepositFactoryTron + +Tron-compatible factory with corrected CREATE2 address prediction (0x41 prefix). No constructor args. ```bash -USP_ADMIN_UPDATE_BUFFER=86400 # Admin update buffer (seconds), e.g. 24h -USP_HELIOS_ADDRESS=T... # Deployed SP1Helios address -USP_HUB_POOL_STORE_ADDRESS=T... # HubPoolStore address -USP_WRAPPED_NATIVE_TOKEN_ADDRESS=T... # WTRX address -USP_DEPOSIT_QUOTE_TIME_BUFFER=3600 # Deposit quote time buffer (seconds) -USP_FILL_DEADLINE_BUFFER=21600 # Fill deadline buffer (seconds) -USP_L2_USDC_ADDRESS=T... # USDC on Tron -USP_CCTP_TOKEN_MESSENGER_ADDRESS=T... # CCTP TokenMessenger, or zero address -USP_OFT_DST_EID=0 # LayerZero OFT endpoint ID, 0 to disable -USP_OFT_FEE_CAP=0 # OFT fee cap in wei, 0 to disable +yarn tron-deploy-counterfactual-factory [--testnet] ``` +### CounterfactualDeposit + +Clone implementation contract used by the factory. No constructor args. Must be deployed before creating clones. + ```bash -yarn tron-deploy-universal-spokepool +yarn tron-deploy-counterfactual-deposit [--testnet] ``` -## Deployment order +### CounterfactualDepositSpokePool -1. **SP1AutoVerifier** (testnet only) or wait for Succinct to deploy the real Groth16 verifier -2. **SP1Helios** — needs the verifier address -3. **Universal_SpokePool** — needs the SP1Helios address +```bash +yarn tron-deploy-counterfactual-deposit-spokepool [--testnet] +``` + +### WithdrawImplementation + +```bash +yarn tron-deploy-withdraw-implementation [--testnet] +``` + +### Deploy Clone + +Deploys a clone from the factory and verifies the predicted address matches the actual deployed address. + +```bash +yarn tron-deploy-counterfactual-clone [--testnet] +``` ## Verifying contracts on TronScan -TronScan requires a single flattened Solidity file for verification. Use `forge flatten`: +TronScan requires a single flattened Solidity file for verification. Flatten with `forge flatten` and fix the merged pragma: ```bash -# Flatten a contract -forge flatten contracts/sp1-helios/SP1Helios.sol > flattened/SP1Helios.sol -forge flatten contracts/sp1-helios/SP1AutoVerifier.sol > flattened/SP1AutoVerifier.sol -forge flatten contracts/Universal_SpokePool.sol > flattened/Universal_SpokePool.sol +forge flatten contracts/sp1-helios/SP1Helios.sol | sed 's/pragma solidity .*/pragma solidity ^0.8.25;/' > flattened/SP1Helios.sol +forge flatten contracts/Universal_SpokePool.sol | sed 's/pragma solidity .*/pragma solidity ^0.8.25;/' > flattened/Universal_SpokePool.sol ``` Then verify on TronScan: @@ -143,6 +165,20 @@ Then verify on TronScan: Each deployment writes a Foundry-compatible broadcast artifact to `broadcast/TronDeploy.s.sol//`. These track deployed addresses and transaction IDs. +## File overview + +| File | Purpose | +| ---------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `deploy.ts` | Shared TronWeb deployer — reads Foundry artifacts, deploys via TronWeb | +| `universal/tron-deploy-sp1-auto-verifier.ts` | Deploys SP1AutoVerifier (no args) | +| `universal/tron-deploy-sp1-helios.ts` | Deploys SP1Helios with genesis binary | +| `universal/tron-deploy-universal-spokepool.ts` | Deploys Universal_SpokePool implementation + ERC1967Proxy | +| `counterfactual/tron-deploy-counterfactual-factory.ts` | Deploys CounterfactualDepositFactoryTron (no args) | +| `counterfactual/tron-deploy-counterfactual-deposit.ts` | Deploys CounterfactualDeposit implementation (no args) | +| `counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts` | Deploys CounterfactualDepositSpokePool | +| `counterfactual/tron-deploy-withdraw-implementation.ts` | Deploys WithdrawImplementation (no args) | +| `counterfactual/tron-deploy-counterfactual-clone.ts` | Deploys a clone from factory, verifies address prediction | + ## Chain IDs | Network | Chain ID | diff --git a/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts b/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts new file mode 100644 index 000000000..77fb37c78 --- /dev/null +++ b/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts @@ -0,0 +1,197 @@ +#!/usr/bin/env ts-node +/** + * Deploys a clone from CounterfactualDepositFactoryTron and verifies address prediction. + * + * Calls predictDepositAddress (view) to get the expected clone address, then calls + * factory.deploy (state-changing) to actually deploy it, and compares the two. + * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn tron-deploy-counterfactual-clone [--testnet] + * + * Addresses in Tron Base58Check format (T...). merkleRoot and salt are 0x-prefixed 32-byte hex values. + */ + +import "dotenv/config"; +import { TronWeb } from "tronweb"; +import { tronToEvmAddress, resolveChainId, TRON_MAINNET_CHAIN_ID, TRON_TESTNET_CHAIN_ID } from "../deploy"; + +const POLL_INTERVAL_MS = 3000; +const MAX_POLL_ATTEMPTS = 40; // ~2 minutes + +const TRONSCAN_URLS: Record = { + [TRON_MAINNET_CHAIN_ID]: "https://tronscan.org", + [TRON_TESTNET_CHAIN_ID]: "https://nile.tronscan.org", +}; + +const BYTES32_RE = /^0x[0-9a-fA-F]{64}$/; + +function validateArgs(factoryAddress: string, implementationAddress: string, merkleRoot: string, salt: string): void { + if (!TronWeb.isAddress(factoryAddress)) { + console.log(`Error: invalid factory address "${factoryAddress}". Expected Tron Base58Check address (T...).`); + process.exit(1); + } + if (!TronWeb.isAddress(implementationAddress)) { + console.log( + `Error: invalid implementation address "${implementationAddress}". Expected Tron Base58Check address (T...).` + ); + process.exit(1); + } + if (!BYTES32_RE.test(merkleRoot)) { + console.log(`Error: invalid merkleRoot "${merkleRoot}". Expected 0x-prefixed 32-byte hex.`); + process.exit(1); + } + if (!BYTES32_RE.test(salt)) { + console.log(`Error: invalid salt "${salt}". Expected 0x-prefixed 32-byte hex.`); + process.exit(1); + } +} + +async function main(): Promise { + const args = process.argv.slice(2).filter((a) => !a.startsWith("-")); + const factoryAddress = args[0]; + const implementationAddress = args[1]; + const merkleRoot = args[2]; + const salt = args[3]; + + if (!factoryAddress || !implementationAddress || !merkleRoot || !salt) { + console.log( + "Usage: yarn tron-deploy-counterfactual-clone [--testnet]" + ); + process.exit(1); + } + + const chainId = resolveChainId(); + + validateArgs(factoryAddress, implementationAddress, merkleRoot, salt); + + const mnemonic = process.env.MNEMONIC; + const fullNode = process.env[`NODE_URL_${chainId}`]; + if (!mnemonic) { + console.log("Error: MNEMONIC env var is required."); + process.exit(1); + } + if (!fullNode) { + console.log(`Error: NODE_URL_${chainId} env var is required.`); + process.exit(1); + } + + const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "1500000000", 10); + + const tronWeb = new TronWeb({ fullHost: fullNode }); + + const { ethersHDNodeWallet, Mnemonic } = tronWeb.utils.ethersUtils; + const mnemonicObj = Mnemonic.fromPhrase(mnemonic); + const wallet = ethersHDNodeWallet.fromMnemonic(mnemonicObj, "m/44'/60'/0'/0/0"); + const privateKey = wallet.privateKey.slice(2); + tronWeb.setPrivateKey(privateKey); + + const factoryTronHex = TronWeb.address.toHex(factoryAddress); + const implementationEvmAddress = tronToEvmAddress(implementationAddress); + const tronscanBase = TRONSCAN_URLS[chainId] || "https://tronscan.org"; + + const fnParams = [ + { type: "address", value: implementationEvmAddress }, + { type: "bytes32", value: merkleRoot }, + { type: "bytes32", value: salt }, + ]; + + // Step 1: Call predictDepositAddress (view call) + console.log("Calling predictDepositAddress..."); + const predictResult = await tronWeb.transactionBuilder.triggerConstantContract( + factoryTronHex, + "predictDepositAddress(address,bytes32,bytes32)", + {}, + fnParams + ); + + if (!predictResult.constant_result?.[0]) { + console.log("Error: predictDepositAddress failed:", JSON.stringify(predictResult, null, 2)); + process.exit(1); + } + + const predictedEvm = "0x" + predictResult.constant_result[0].slice(24); + console.log(`Predicted address: ${predictedEvm}`); + + // Step 2: Call factory.deploy (state-changing transaction) + console.log(`\nCalling factory.deploy on ${fullNode}...`); + console.log(` Factory: ${factoryAddress}`); + console.log(` Implementation: ${implementationAddress}`); + console.log(` Merkle root: ${merkleRoot}`); + console.log(` Salt: ${salt}`); + console.log(` Fee limit: ${feeLimit} sun (${feeLimit / 1e6} TRX)`); + + const deployTx = await tronWeb.transactionBuilder.triggerSmartContract( + factoryTronHex, + "deploy(address,bytes32,bytes32)", + { feeLimit }, + fnParams + ); + + if (!deployTx.result?.result) { + console.log("Error: triggerSmartContract failed:", JSON.stringify(deployTx, null, 2)); + process.exit(1); + } + + const signedTx = await tronWeb.trx.sign(deployTx.transaction); + const broadcastResult = await tronWeb.trx.sendRawTransaction(signedTx); + + if (!(broadcastResult as any).result) { + console.log("Error: transaction rejected:", JSON.stringify(broadcastResult, null, 2)); + process.exit(1); + } + + const txID: string = (broadcastResult as any).txid || (broadcastResult as any).transaction?.txID; + console.log(`Transaction sent: ${txID}`); + + // Step 3: Poll for confirmation + let txInfo: any; + for (let i = 0; i < MAX_POLL_ATTEMPTS; i++) { + await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS)); + txInfo = await tronWeb.trx.getTransactionInfo(txID); + if (txInfo && txInfo.id) break; + console.log(`Waiting for confirmation... (${i + 1}/${MAX_POLL_ATTEMPTS})`); + } + + if (!txInfo?.id) { + console.log("Error: transaction not confirmed within timeout."); + process.exit(1); + } + + if (txInfo.receipt?.result !== "SUCCESS") { + console.log("Error: transaction failed:", JSON.stringify(txInfo, null, 2)); + process.exit(1); + } + + // Step 4: Extract deployed address from the DepositAddressCreated event + const log = txInfo.log?.[0]; + if (!log?.topics?.[1]) { + console.log("Error: no DepositAddressCreated event in transaction."); + process.exit(1); + } + + const deployedEvm = "0x" + log.topics[1].slice(24); + const deployedTronHex = "41" + log.topics[1].slice(24); + const deployedBase58 = tronWeb.address.fromHex(deployedTronHex); + const match = predictedEvm.toLowerCase() === deployedEvm.toLowerCase(); + + console.log(`\nClone deployed!`); + console.log(` Predicted: ${predictedEvm}`); + console.log(` Deployed: ${deployedEvm}`); + console.log(` Tron addr: ${deployedBase58}`); + console.log(` Match: ${match}`); + console.log(` TX ID: ${txID}`); + console.log(` Tronscan: ${tronscanBase}/#/contract/${deployedBase58}`); + + if (!match) { + console.log("\nERROR: Address prediction mismatch!"); + process.exit(1); + } +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/tron/counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts b/script/tron/counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts new file mode 100644 index 000000000..03cd06f33 --- /dev/null +++ b/script/tron/counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts @@ -0,0 +1,62 @@ +#!/usr/bin/env ts-node +/** + * Deploys CounterfactualDepositSpokePool to Tron. + * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn tron-deploy-counterfactual-deposit-spokepool [--testnet] + */ + +import "dotenv/config"; +import * as path from "path"; +import { TronWeb } from "tronweb"; +import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId } from "../deploy"; + +function validateAddress(value: string, name: string): void { + if (!TronWeb.isAddress(value)) { + console.log(`Error: invalid ${name} "${value}". Expected Tron Base58Check address (T...).`); + process.exit(1); + } +} + +async function main(): Promise { + const args = process.argv.slice(2).filter((a) => !a.startsWith("-")); + const spokePool = args[0]; + const signer = args[1]; + const wrappedNativeToken = args[2]; + + if (!spokePool || !signer || !wrappedNativeToken) { + console.log( + "Usage: yarn tron-deploy-counterfactual-deposit-spokepool [--testnet]" + ); + process.exit(1); + } + + validateAddress(spokePool, "spokePool"); + validateAddress(signer, "signer"); + validateAddress(wrappedNativeToken, "wrappedNativeToken"); + + const chainId = resolveChainId(); + + console.log("=== CounterfactualDepositSpokePool Deployment ==="); + console.log(`Chain ID: ${chainId}`); + + const encodedArgs = encodeArgs( + ["address", "address", "address"], + [tronToEvmAddress(spokePool), tronToEvmAddress(signer), tronToEvmAddress(wrappedNativeToken)] + ); + + const artifactPath = path.resolve( + __dirname, + "../../../out-tron/CounterfactualDepositSpokePool.sol/CounterfactualDepositSpokePool.json" + ); + + await deployContract({ chainId, artifactPath, encodedArgs }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/tron/counterfactual/tron-deploy-counterfactual-deposit.ts b/script/tron/counterfactual/tron-deploy-counterfactual-deposit.ts new file mode 100644 index 000000000..419f85914 --- /dev/null +++ b/script/tron/counterfactual/tron-deploy-counterfactual-deposit.ts @@ -0,0 +1,35 @@ +#!/usr/bin/env ts-node +/** + * Deploys CounterfactualDeposit to Tron. No constructor args. + * + * This is the implementation contract that the factory deploys clones of. + * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn tron-deploy-counterfactual-deposit [--testnet] + */ + +import "dotenv/config"; +import * as path from "path"; +import { deployContract, resolveChainId } from "../deploy"; + +async function main(): Promise { + const chainId = resolveChainId(); + + console.log("=== CounterfactualDeposit Deployment ==="); + console.log(`Chain ID: ${chainId}`); + + const artifactPath = path.resolve( + __dirname, + "../../../out-tron/CounterfactualDeposit.sol/CounterfactualDeposit.json" + ); + + await deployContract({ chainId, artifactPath }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/tron/counterfactual/tron-deploy-counterfactual-factory.ts b/script/tron/counterfactual/tron-deploy-counterfactual-factory.ts new file mode 100644 index 000000000..fdb0e4f20 --- /dev/null +++ b/script/tron/counterfactual/tron-deploy-counterfactual-factory.ts @@ -0,0 +1,33 @@ +#!/usr/bin/env ts-node +/** + * Deploys CounterfactualDepositFactoryTron to Tron. No constructor args. + * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn tron-deploy-counterfactual-factory [--testnet] + */ + +import "dotenv/config"; +import * as path from "path"; +import { deployContract, resolveChainId } from "../deploy"; + +async function main(): Promise { + const chainId = resolveChainId(); + + console.log("=== CounterfactualDepositFactoryTron Deployment ==="); + console.log(`Chain ID: ${chainId}`); + + const artifactPath = path.resolve( + __dirname, + "../../../out-tron/CounterfactualDepositFactoryTron.sol/CounterfactualDepositFactoryTron.json" + ); + + await deployContract({ chainId, artifactPath }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/tron/counterfactual/tron-deploy-withdraw-implementation.ts b/script/tron/counterfactual/tron-deploy-withdraw-implementation.ts new file mode 100644 index 000000000..bcc27a5df --- /dev/null +++ b/script/tron/counterfactual/tron-deploy-withdraw-implementation.ts @@ -0,0 +1,33 @@ +#!/usr/bin/env ts-node +/** + * Deploys WithdrawImplementation to Tron. No constructor args. + * + * Options: + * --testnet — deploy to Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn tron-deploy-withdraw-implementation [--testnet] + */ + +import "dotenv/config"; +import * as path from "path"; +import { deployContract, resolveChainId } from "../deploy"; + +async function main(): Promise { + const chainId = resolveChainId(); + + console.log("=== WithdrawImplementation Deployment ==="); + console.log(`Chain ID: ${chainId}`); + + const artifactPath = path.resolve( + __dirname, + "../../../out-tron/WithdrawImplementation.sol/WithdrawImplementation.json" + ); + + await deployContract({ chainId, artifactPath }); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/universal/tron/deploy.ts b/script/tron/deploy.ts similarity index 99% rename from script/universal/tron/deploy.ts rename to script/tron/deploy.ts index f8778e17b..9593c98bc 100644 --- a/script/universal/tron/deploy.ts +++ b/script/tron/deploy.ts @@ -140,7 +140,7 @@ function writeBroadcastArtifact(opts: { chain: chainIdNum, }; - const broadcastDir = path.resolve(__dirname, "../../../broadcast", scriptName, opts.chainId); + const broadcastDir = path.resolve(__dirname, "../../broadcast", scriptName, opts.chainId); fs.mkdirSync(broadcastDir, { recursive: true }); const json = JSON.stringify(broadcast, null, 2) + "\n"; diff --git a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts b/script/tron/universal/tron-deploy-sp1-auto-verifier.ts similarity index 94% rename from script/universal/tron/tron-deploy-sp1-auto-verifier.ts rename to script/tron/universal/tron-deploy-sp1-auto-verifier.ts index 615acfc5d..1ae3d0d19 100644 --- a/script/universal/tron/tron-deploy-sp1-auto-verifier.ts +++ b/script/tron/universal/tron-deploy-sp1-auto-verifier.ts @@ -18,7 +18,7 @@ */ import * as path from "path"; -import { deployContract, resolveChainId } from "./deploy"; +import { deployContract, resolveChainId } from "../deploy"; async function main(): Promise { const chainId = resolveChainId(); diff --git a/script/universal/tron/tron-deploy-sp1-helios.ts b/script/tron/universal/tron-deploy-sp1-helios.ts similarity index 98% rename from script/universal/tron/tron-deploy-sp1-helios.ts rename to script/tron/universal/tron-deploy-sp1-helios.ts index e8d8ce9c9..9cfd8c88d 100644 --- a/script/universal/tron/tron-deploy-sp1-helios.ts +++ b/script/tron/universal/tron-deploy-sp1-helios.ts @@ -35,7 +35,7 @@ import * as path from "path"; import * as os from "os"; import { execSync } from "child_process"; import { createHash } from "crypto"; -import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId } from "./deploy"; +import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId } from "../deploy"; import { TronWeb as TronWebImport } from "tronweb"; const GITHUB_RELEASE_URL = "https://github.com/across-protocol/sp1-helios/releases"; @@ -86,7 +86,7 @@ function downloadGenesisBinary(version: string): string { function verifyBinaryChecksum(binaryName: string, binaryPath: string): void { console.log("Verifying binary checksum..."); - const checksumsPath = path.resolve(SCRIPT_DIR, "../checksums.json"); + const checksumsPath = path.resolve(SCRIPT_DIR, "../../universal/checksums.json"); const checksums: Record = JSON.parse(fs.readFileSync(checksumsPath, "utf-8")); const expectedChecksum = checksums[binaryName]; diff --git a/script/universal/tron/tron-deploy-universal-spokepool.ts b/script/tron/universal/tron-deploy-universal-spokepool.ts similarity index 99% rename from script/universal/tron/tron-deploy-universal-spokepool.ts rename to script/tron/universal/tron-deploy-universal-spokepool.ts index 028f78ae1..4de888bc5 100644 --- a/script/universal/tron/tron-deploy-universal-spokepool.ts +++ b/script/tron/universal/tron-deploy-universal-spokepool.ts @@ -21,7 +21,7 @@ import "dotenv/config"; import * as fs from "fs"; import * as path from "path"; -import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId, TRON_TESTNET_CHAIN_ID } from "./deploy"; +import { deployContract, encodeArgs, tronToEvmAddress, resolveChainId, TRON_TESTNET_CHAIN_ID } from "../deploy"; // WTRX (Wrapped TRX) contract address const WTRX_ADDRESS = "TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"; From 0c05cb273cfb1374413f4b35a473761f95ef6996 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Fri, 27 Mar 2026 13:34:53 -0600 Subject: [PATCH 13/19] add comment explaining pure override --- contracts/sp1-helios/SP1AutoVerifier.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/sp1-helios/SP1AutoVerifier.sol b/contracts/sp1-helios/SP1AutoVerifier.sol index a77b7737b..89314c4b2 100644 --- a/contracts/sp1-helios/SP1AutoVerifier.sol +++ b/contracts/sp1-helios/SP1AutoVerifier.sol @@ -6,5 +6,6 @@ import { ISP1Verifier } from "@sp1-contracts/src/ISP1Verifier.sol"; /// @title SP1 Auto Verifier /// @notice A no-op verifier that accepts any proof. Useful for testing SP1Helios without real proofs. contract SP1AutoVerifier is ISP1Verifier { + // pure is intentionally stricter than the interface's view; Solidity allows this and it's correct for a no-op. function verifyProof(bytes32, bytes calldata, bytes calldata) external pure {} } From d951fe08062013e856c662c0bd2bc74d6e574ffa Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Mon, 30 Mar 2026 13:52:41 -0600 Subject: [PATCH 14/19] update UniversalSpokePool import --- contracts/tron/TronImports.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/tron/TronImports.sol b/contracts/tron/TronImports.sol index 0a7a3d77b..df5b6c5ca 100644 --- a/contracts/tron/TronImports.sol +++ b/contracts/tron/TronImports.sol @@ -5,4 +5,4 @@ pragma solidity ^0.8.0; // and must be in a separate file from counterfactual contracts (OZ v4) to avoid name collisions. import "../sp1-helios/SP1Helios.sol"; import "../sp1-helios/SP1AutoVerifier.sol"; -import "../Universal_SpokePool.sol"; +import "../spoke-pools/Universal_SpokePool.sol"; From 6a56ef0a587dd0c5cab103744ae552fd1828fab0 Mon Sep 17 00:00:00 2001 From: bennett Date: Tue, 31 Mar 2026 14:36:02 -0500 Subject: [PATCH 15/19] prerelease Signed-off-by: bennett --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 481e7ea33..2ae76f220 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "5.0.4", + "version": "5.0.5-alpha.0", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": { From 9539668dbc2f34d64bd210e485e2c70900554878 Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Thu, 2 Apr 2026 10:04:24 -0600 Subject: [PATCH 16/19] update tron deploy scripts --- broadcast/deployed-addresses.json | 5 + broadcast/deployed-addresses.md | 1 + package.json | 4 +- script/tron/README.md | 2 +- .../tron/counterfactual/tron-deploy-clone.ts | 226 ++++++++++++++++ .../tron-deploy-counterfactual-clone.ts | 2 +- .../tron-execute-clone-deposit.ts | 243 ++++++++++++++++++ script/tron/deploy.ts | 4 +- .../tron-deploy-sp1-auto-verifier.ts | 2 +- 9 files changed, 483 insertions(+), 6 deletions(-) create mode 100644 script/tron/counterfactual/tron-deploy-clone.ts create mode 100644 script/tron/counterfactual/tron-execute-clone-deposit.ts diff --git a/broadcast/deployed-addresses.json b/broadcast/deployed-addresses.json index 74c4ffbae..205a55d1c 100644 --- a/broadcast/deployed-addresses.json +++ b/broadcast/deployed-addresses.json @@ -240,6 +240,11 @@ "block_number": 24421479, "transaction_hash": "0x0969ace8106c5b2b49d16acf429033531961704e89369e236eb903c2f371b206" }, + "Universal_Adapter_728126428": { + "address": "0xA1da1A70cc9F27F4aEDff1d515B1a0C47fb6c3Db", + "block_number": 24780350, + "transaction_hash": "0x42ee92932f8f746d6f215d895dc5462d492979bc5f10ca539bc1c8d3f7c6eabe" + }, "WithdrawImplementation": { "address": "0xbCc541C5AeD10843C75336c2d32D363Db6eCF351", "block_number": 24642482, diff --git a/broadcast/deployed-addresses.md b/broadcast/deployed-addresses.md index 89232a397..b927575cc 100644 --- a/broadcast/deployed-addresses.md +++ b/broadcast/deployed-addresses.md @@ -55,6 +55,7 @@ This file contains the latest deployed smart contract addresses from the broadca | Universal_Adapter_143 | [0xC29a3Ba0fBf477F16Fd53d2C438Eade024FD8452](https://etherscan.io/address/0xC29a3Ba0fBf477F16Fd53d2C438Eade024FD8452) | | Universal_Adapter_4217 | [0x4577980eBFCC6fC8ff516aC06dA9e729c40cA57c](https://etherscan.io/address/0x4577980eBFCC6fC8ff516aC06dA9e729c40cA57c) | | Universal_Adapter_56 | [0x6f1C9d3bcDF51316E7b515a62C02F601500b084b](https://etherscan.io/address/0x6f1C9d3bcDF51316E7b515a62C02F601500b084b) | +| Universal_Adapter_728126428 | [0xA1da1A70cc9F27F4aEDff1d515B1a0C47fb6c3Db](https://etherscan.io/address/0xA1da1A70cc9F27F4aEDff1d515B1a0C47fb6c3Db) | | Universal_Adapter_9745 | [0xb47fD69FE25878F4E43aAF2F9ad7D0A3A0B22363](https://etherscan.io/address/0xb47fD69FE25878F4E43aAF2F9ad7D0A3A0B22363) | | Universal_Adapter_999 | [0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B](https://etherscan.io/address/0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B) | | WithdrawImplementation | [0xbCc541C5AeD10843C75336c2d32D363Db6eCF351](https://etherscan.io/address/0xbCc541C5AeD10843C75336c2d32D363Db6eCF351) | diff --git a/package.json b/package.json index 2ae76f220..eafd5d535 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,9 @@ "tron-deploy-counterfactual-deposit": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-deposit.ts", "tron-deploy-counterfactual-deposit-spokepool": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-deposit-spokepool.ts", "tron-deploy-withdraw-implementation": "ts-node script/tron/counterfactual/tron-deploy-withdraw-implementation.ts", - "tron-deploy-counterfactual-clone": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-clone.ts" + "tron-deploy-counterfactual-clone": "ts-node script/tron/counterfactual/tron-deploy-counterfactual-clone.ts", + "tron-deploy-clone": "ts-node script/tron/counterfactual/tron-deploy-clone.ts", + "tron-execute-clone-deposit": "ts-node script/tron/counterfactual/tron-execute-clone-deposit.ts" }, "dependencies": { "@across-protocol/constants": "^3.1.100", diff --git a/script/tron/README.md b/script/tron/README.md index b45dab3ef..48b00fc8d 100644 --- a/script/tron/README.md +++ b/script/tron/README.md @@ -47,7 +47,7 @@ NODE_URL_728126428=https://api.trongrid.io # Tron mainnet NODE_URL_3448148188=https://nile.trongrid.io # Tron Nile testnet # Optional -TRON_FEE_LIMIT=1500000000 # Fee limit in sun (default: 1500 TRX) +TRON_FEE_LIMIT=100000000 # Fee limit in sun (default: 100 TRX) ``` > **Important:** Use the base TronGrid URL (`https://api.trongrid.io`), NOT the `/jsonrpc` endpoint. TronWeb needs the native Tron API, not the Ethereum-compatible JSON-RPC endpoint. diff --git a/script/tron/counterfactual/tron-deploy-clone.ts b/script/tron/counterfactual/tron-deploy-clone.ts new file mode 100644 index 000000000..71f84843a --- /dev/null +++ b/script/tron/counterfactual/tron-deploy-clone.ts @@ -0,0 +1,226 @@ +#!/usr/bin/env ts-node +/** + * Deploys a counterfactual deposit clone for testing. + * + * Builds a merkle tree with a single leaf for CounterfactualDepositSpokePool, + * then deploys a clone via the factory. Outputs the clone address and all parameters + * needed by the execute script. + * + * Env vars: + * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) + * NODE_URL_728126428 — Tron mainnet full node URL + * NODE_URL_3448148188 — Tron Nile testnet full node URL + * TRON_FEE_LIMIT — optional, in sun (default: 100000000 = 100 TRX) + * + * Options: + * --testnet — use Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn test-deploy-clone [--testnet] + * + * Addresses in Tron Base58Check format (T...). + */ + +import "dotenv/config"; +import { TronWeb } from "tronweb"; +import { utils as ethersUtils } from "ethers"; +import { tronToEvmAddress, resolveChainId, TRON_MAINNET_CHAIN_ID, TRON_TESTNET_CHAIN_ID } from "../deploy"; + +const POLL_INTERVAL_MS = 3000; +const MAX_POLL_ATTEMPTS = 40; + +const TRONSCAN_URLS: Record = { + [TRON_MAINNET_CHAIN_ID]: "https://tronscan.org", + [TRON_TESTNET_CHAIN_ID]: "https://nile.tronscan.org", +}; + +const DESTINATION_CHAIN_ID = 1; + +async function main(): Promise { + const args = process.argv.slice(2).filter((a) => !a.startsWith("-")); + const factoryAddress = args[0]; + const counterfactualDepositImpl = args[1]; + const spokePoolDepositImpl = args[2]; + const inputTokenAddress = args[3]; + + if (!factoryAddress || !counterfactualDepositImpl || !spokePoolDepositImpl || !inputTokenAddress) { + console.log( + "Usage: yarn test-deploy-clone [--testnet]" + ); + process.exit(1); + } + + for (const [name, addr] of Object.entries({ + factory: factoryAddress, + "counterfactual-deposit-impl": counterfactualDepositImpl, + "spokepool-deposit-impl": spokePoolDepositImpl, + "input-token": inputTokenAddress, + })) { + if (!TronWeb.isAddress(addr)) { + console.log(`Error: invalid ${name} "${addr}".`); + process.exit(1); + } + } + + const chainId = resolveChainId(); + const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "100000000", 10); + + const mnemonic = process.env.MNEMONIC; + const fullNode = process.env[`NODE_URL_${chainId}`]; + if (!mnemonic) { + console.log("Error: MNEMONIC env var is required."); + process.exit(1); + } + if (!fullNode) { + console.log(`Error: NODE_URL_${chainId} env var is required.`); + process.exit(1); + } + + const tronWeb = new TronWeb({ fullHost: fullNode }); + const { ethersHDNodeWallet, Mnemonic } = tronWeb.utils.ethersUtils; + const mnemonicObj = Mnemonic.fromPhrase(mnemonic); + const wallet = ethersHDNodeWallet.fromMnemonic(mnemonicObj, "m/44'/60'/0'/0/0"); + tronWeb.setPrivateKey(wallet.privateKey.slice(2)); + + const signerEvmAddress = tronToEvmAddress(tronWeb.address.fromPrivateKey(wallet.privateKey.slice(2)) as string); + const factoryTronHex = TronWeb.address.toHex(factoryAddress); + const counterfactualDepositImplEvm = tronToEvmAddress(counterfactualDepositImpl); + const spokePoolDepositImplEvm = tronToEvmAddress(spokePoolDepositImpl); + const inputTokenEvmAddress = tronToEvmAddress(inputTokenAddress); + const tronscanBase = TRONSCAN_URLS[chainId] || "https://tronscan.org"; + + console.log("=== Deploy Counterfactual Clone ==="); + console.log(`Chain ID: ${chainId}`); + console.log(`Factory: ${factoryAddress}`); + console.log(`CounterfactualDeposit impl: ${counterfactualDepositImpl} (${counterfactualDepositImplEvm})`); + console.log(`SpokePoolDeposit impl: ${spokePoolDepositImpl} (${spokePoolDepositImplEvm})`); + console.log(`Input token: ${inputTokenAddress} (${inputTokenEvmAddress})`); + console.log(`Signer/recipient: ${signerEvmAddress}`); + + // --- Build merkle tree --- + // SpokePoolDepositParams struct encoded as a tuple + const recipientBytes32 = "0x" + signerEvmAddress.slice(2).padStart(64, "0"); + const inputTokenBytes32 = "0x" + inputTokenEvmAddress.slice(2).padStart(64, "0"); + const outputTokenBytes32 = inputTokenBytes32; + + const paramsEncoded = tronWeb.utils.abi.encodeParams( + ["(uint256,bytes32,bytes32,bytes32,bytes,uint256,uint256,uint256,uint256)"], + [ + [ + DESTINATION_CHAIN_ID, + inputTokenBytes32, + outputTokenBytes32, + recipientBytes32, + "0x", // empty message + "1000000000000000000", // stableExchangeRate = 1e18 (1:1) + "1000000000", // maxFeeFixed (high for testing) + "10000", // maxFeeBps = 100% + "0", // executionFee + ], + ] + ); + + const paramsHash = ethersUtils.keccak256(paramsEncoded); + + // Merkle leaf: keccak256(bytes.concat(keccak256(abi.encode(implementation, keccak256(params))))) + // This is OpenZeppelin's double-hash standard to prevent leaf/internal-node ambiguity. + const innerEncoding = ethersUtils.defaultAbiCoder.encode( + ["address", "bytes32"], + [spokePoolDepositImplEvm, paramsHash] + ); + const innerHash = ethersUtils.keccak256(innerEncoding); + const leaf = ethersUtils.keccak256(innerHash); + + // For a single-leaf tree, the merkle root IS the leaf (proof is empty). + const merkleRoot = leaf; + + console.log(`\n--- Merkle tree ---`); + console.log(` paramsHash: ${paramsHash}`); + console.log(` innerEncoding: abi.encode(${spokePoolDepositImplEvm}, ${paramsHash})`); + console.log(` innerHash: ${innerHash}`); + console.log(` leaf (root): ${merkleRoot}`); + console.log(` proof: [] (single leaf)`); + + // Salt + const salt = ethersUtils.id("test-clone-" + Date.now()); + console.log(` salt: ${salt}`); + + // --- Predict address --- + console.log(`\n--- Predicting clone address ---`); + const predictResult = await tronWeb.transactionBuilder.triggerConstantContract( + factoryTronHex, + "predictDepositAddress(address,bytes32,bytes32)", + {}, + [ + { type: "address", value: counterfactualDepositImplEvm }, + { type: "bytes32", value: merkleRoot }, + { type: "bytes32", value: salt }, + ] + ); + + const predictedEvm = "0x" + predictResult.constant_result[0].slice(24); + const predictedTronHex = "41" + predictResult.constant_result[0].slice(24); + const predictedBase58 = tronWeb.address.fromHex(predictedTronHex) as string; + console.log(` Predicted: ${predictedBase58} (${predictedEvm})`); + + // --- Deploy clone --- + console.log(`\n--- Deploying clone ---`); + const deployTx = await tronWeb.transactionBuilder.triggerSmartContract( + factoryTronHex, + "deploy(address,bytes32,bytes32)", + { feeLimit }, + [ + { type: "address", value: counterfactualDepositImplEvm }, + { type: "bytes32", value: merkleRoot }, + { type: "bytes32", value: salt }, + ] + ); + + if (!deployTx.result?.result) { + console.log("Error: deploy failed:", JSON.stringify(deployTx, null, 2)); + process.exit(1); + } + + const signedDeploy = await tronWeb.trx.sign(deployTx.transaction); + const deployResult = await tronWeb.trx.sendRawTransaction(signedDeploy); + if (!(deployResult as any).result) { + console.log("Error: deploy rejected:", JSON.stringify(deployResult, null, 2)); + process.exit(1); + } + + const deployTxID = (deployResult as any).txid || (deployResult as any).transaction?.txID; + console.log(` Deploy tx: ${deployTxID}`); + const deployInfo = await waitForConfirmation(tronWeb, deployTxID); + + if (deployInfo.receipt?.result !== "SUCCESS") { + console.log("Error: clone deploy failed:", JSON.stringify(deployInfo, null, 2)); + process.exit(1); + } + + console.log(`\nClone deployed!`); + console.log(` Address: ${predictedBase58} (${predictedEvm})`); + console.log(` TX ID: ${deployTxID}`); + console.log(` Energy: ${deployInfo.receipt?.energy_usage_total}`); + console.log(` Tronscan: ${tronscanBase}/#/transaction/${deployTxID}`); + + console.log(`\n--- Execute script command ---`); + console.log( + `yarn tron-execute-clone-deposit ${predictedBase58} ${spokePoolDepositImpl} ${inputTokenAddress} ${chainId !== TRON_MAINNET_CHAIN_ID ? " --testnet" : ""}` + ); +} + +async function waitForConfirmation(tronWeb: TronWeb, txID: string): Promise { + for (let i = 0; i < MAX_POLL_ATTEMPTS; i++) { + await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS)); + const txInfo = await tronWeb.trx.getTransactionInfo(txID); + if (txInfo && (txInfo as any).id) return txInfo; + console.log(` Waiting... (${i + 1}/${MAX_POLL_ATTEMPTS})`); + } + console.log("Error: not confirmed within timeout."); + process.exit(1); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts b/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts index 77fb37c78..cbba0d912 100644 --- a/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts +++ b/script/tron/counterfactual/tron-deploy-counterfactual-clone.ts @@ -78,7 +78,7 @@ async function main(): Promise { process.exit(1); } - const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "1500000000", 10); + const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "100000000", 10); const tronWeb = new TronWeb({ fullHost: fullNode }); diff --git a/script/tron/counterfactual/tron-execute-clone-deposit.ts b/script/tron/counterfactual/tron-execute-clone-deposit.ts new file mode 100644 index 000000000..0e8805808 --- /dev/null +++ b/script/tron/counterfactual/tron-execute-clone-deposit.ts @@ -0,0 +1,243 @@ +#!/usr/bin/env ts-node +/** + * Executes a deposit through a deployed counterfactual clone on Tron. + * + * Steps: + * 1. Transfer tokens to the clone + * 2. Sign EIP-712 ExecuteDeposit (verifyingContract = clone address) + * 3. Call clone.execute(implementation, params, submitterData, proof) + * + * The route params (destination chain, tokens, recipient, fee settings) are reconstructed + * identically to test-deploy-clone.ts so the merkle proof validates. + * + * Env vars: + * MNEMONIC — BIP-39 mnemonic (derives account 0 private key, also used as signer) + * NODE_URL_728126428 — Tron mainnet full node URL + * NODE_URL_3448148188 — Tron Nile testnet full node URL + * TRON_FEE_LIMIT — optional, in sun (default: 100000000 = 100 TRX) + * + * Options: + * --testnet — use Tron Nile testnet (default: mainnet) + * + * Usage: + * yarn test-execute-clone-deposit [--testnet] + * + * Addresses in Tron Base58Check format (T...). input-amount in token base units. + */ + +import "dotenv/config"; +import { TronWeb } from "tronweb"; +import { tronToEvmAddress, resolveChainId, TRON_MAINNET_CHAIN_ID, TRON_TESTNET_CHAIN_ID } from "../deploy"; + +const POLL_INTERVAL_MS = 3000; +const MAX_POLL_ATTEMPTS = 40; + +const TRONSCAN_URLS: Record = { + [TRON_MAINNET_CHAIN_ID]: "https://tronscan.org", + [TRON_TESTNET_CHAIN_ID]: "https://nile.tronscan.org", +}; + +const DESTINATION_CHAIN_ID = 1; + +async function main(): Promise { + const args = process.argv.slice(2).filter((a) => !a.startsWith("-")); + const cloneAddress = args[0]; + const spokePoolDepositImpl = args[1]; + const inputTokenAddress = args[2]; + const inputAmountStr = args[3]; + + if (!cloneAddress || !spokePoolDepositImpl || !inputTokenAddress || !inputAmountStr) { + console.log( + "Usage: yarn test-execute-clone-deposit [--testnet]" + ); + process.exit(1); + } + + for (const [name, addr] of Object.entries({ + clone: cloneAddress, + "spokepool-deposit-impl": spokePoolDepositImpl, + "input-token": inputTokenAddress, + })) { + if (!TronWeb.isAddress(addr)) { + console.log(`Error: invalid ${name} "${addr}".`); + process.exit(1); + } + } + + const inputAmount = BigInt(inputAmountStr); + const chainId = resolveChainId(); + const feeLimit = parseInt(process.env.TRON_FEE_LIMIT || "100000000", 10); + + const mnemonic = process.env.MNEMONIC; + const fullNode = process.env[`NODE_URL_${chainId}`]; + if (!mnemonic) { + console.log("Error: MNEMONIC env var is required."); + process.exit(1); + } + if (!fullNode) { + console.log(`Error: NODE_URL_${chainId} env var is required.`); + process.exit(1); + } + + const tronWeb = new TronWeb({ fullHost: fullNode }); + const { ethersHDNodeWallet, Mnemonic } = tronWeb.utils.ethersUtils; + const mnemonicObj = Mnemonic.fromPhrase(mnemonic); + const wallet = ethersHDNodeWallet.fromMnemonic(mnemonicObj, "m/44'/60'/0'/0/0"); + tronWeb.setPrivateKey(wallet.privateKey.slice(2)); + + const signerEvmAddress = tronToEvmAddress(tronWeb.address.fromPrivateKey(wallet.privateKey.slice(2)) as string); + const cloneEvmAddress = tronToEvmAddress(cloneAddress); + const spokePoolDepositImplEvm = tronToEvmAddress(spokePoolDepositImpl); + const inputTokenEvmAddress = tronToEvmAddress(inputTokenAddress); + const tronscanBase = TRONSCAN_URLS[chainId] || "https://tronscan.org"; + + console.log("=== Execute Clone Deposit ==="); + console.log(`Chain ID: ${chainId}`); + console.log(`Clone: ${cloneAddress} (${cloneEvmAddress})`); + console.log(`SpokePoolDeposit impl: ${spokePoolDepositImpl} (${spokePoolDepositImplEvm})`); + console.log(`Input token: ${inputTokenAddress} (${inputTokenEvmAddress})`); + console.log(`Input amount: ${inputAmount.toString()}`); + console.log(`Signer: ${signerEvmAddress}`); + + // --- Step 1: Sign EIP-712 --- + // verifyingContract = clone address (delegatecall preserves address(this)) + console.log("\n--- Step 1: Signing EIP-712 ExecuteDeposit ---"); + + const now = Math.floor(Date.now() / 1000); + const quoteTimestamp = now; + const fillDeadline = now + 21600; + const signatureDeadline = now + 3600; + const exclusivityDeadline = 0; + const outputAmount = (inputAmount * 99n) / 100n; + const executionFee = 0n; + const exclusiveRelayer = "0x" + "00".repeat(32); + + const domain = { + name: "CounterfactualDepositSpokePool", + version: "v1.0.0", + chainId: parseInt(chainId), + verifyingContract: cloneEvmAddress, + }; + + const types = { + ExecuteDeposit: [ + { name: "inputAmount", type: "uint256" }, + { name: "outputAmount", type: "uint256" }, + { name: "exclusiveRelayer", type: "bytes32" }, + { name: "exclusivityDeadline", type: "uint32" }, + { name: "quoteTimestamp", type: "uint32" }, + { name: "fillDeadline", type: "uint32" }, + { name: "signatureDeadline", type: "uint32" }, + ], + }; + + const eip712Message = { + inputAmount: inputAmount.toString(), + outputAmount: outputAmount.toString(), + exclusiveRelayer, + exclusivityDeadline, + quoteTimestamp, + fillDeadline, + signatureDeadline, + }; + + const signature = await wallet.signTypedData(domain, types, eip712Message); + console.log(` Signature: ${signature}`); + + // --- Step 2: Call execute on clone --- + console.log("\n--- Step 2: Calling clone.execute() ---"); + + // Reconstruct the same params encoding used by test-deploy-clone.ts. + // These must match exactly so keccak256(params) produces the same leaf. + const recipientBytes32 = "0x" + signerEvmAddress.slice(2).padStart(64, "0"); + const inputTokenBytes32 = "0x" + inputTokenEvmAddress.slice(2).padStart(64, "0"); + const outputTokenBytes32 = inputTokenBytes32; + + const paramsEncoded = tronWeb.utils.abi.encodeParams( + ["(uint256,bytes32,bytes32,bytes32,bytes,uint256,uint256,uint256,uint256)"], + [ + [ + DESTINATION_CHAIN_ID, + inputTokenBytes32, + outputTokenBytes32, + recipientBytes32, + "0x", // empty message + "1000000000000000000", // stableExchangeRate = 1e18 + "1000000000", // maxFeeFixed (must match deploy script) + "10000", // maxFeeBps = 100% + executionFee.toString(), + ], + ] + ); + + const submitterDataEncoded = tronWeb.utils.abi.encodeParams( + ["(uint256,uint256,bytes32,uint32,address,uint32,uint32,uint32,bytes)"], + [ + [ + inputAmount.toString(), + outputAmount.toString(), + exclusiveRelayer, + exclusivityDeadline, + signerEvmAddress, + quoteTimestamp, + fillDeadline, + signatureDeadline, + signature, + ], + ] + ); + + // Single-leaf merkle tree: proof is empty. + const merkleProof: string[] = []; + + // Clone's execute: execute(address implementation, bytes params, bytes submitterData, bytes32[] proof) + const cloneExecuteAbi = [ + { + type: "function", + name: "execute", + inputs: [ + { name: "implementation", type: "address" }, + { name: "params", type: "bytes" }, + { name: "submitterData", type: "bytes" }, + { name: "proof", type: "bytes32[]" }, + ], + outputs: [], + stateMutability: "payable", + }, + ]; + + const cloneContract = tronWeb.contract(cloneExecuteAbi, cloneAddress); + const executeTxID: string = await cloneContract.methods + .execute(spokePoolDepositImplEvm, paramsEncoded, submitterDataEncoded, merkleProof) + .send({ feeLimit }); + + console.log(` Execute tx: ${executeTxID}`); + const txInfo = await waitForConfirmation(tronWeb, executeTxID); + + if (txInfo.receipt?.result !== "SUCCESS") { + console.log("Error: execute failed:", JSON.stringify(txInfo, null, 2)); + process.exit(1); + } + + console.log(`\nDeposit executed!`); + console.log(` Clone: ${cloneAddress}`); + console.log(` TX ID: ${executeTxID}`); + console.log(` Tronscan: ${tronscanBase}/#/transaction/${executeTxID}`); + console.log(` Energy: ${txInfo.receipt?.energy_usage_total || "unknown"}`); +} + +async function waitForConfirmation(tronWeb: TronWeb, txID: string): Promise { + for (let i = 0; i < MAX_POLL_ATTEMPTS; i++) { + await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS)); + const txInfo = await tronWeb.trx.getTransactionInfo(txID); + if (txInfo && (txInfo as any).id) return txInfo; + console.log(` Waiting... (${i + 1}/${MAX_POLL_ATTEMPTS})`); + } + console.log("Error: not confirmed within timeout."); + process.exit(1); +} + +main().catch((err) => { + console.log("Fatal error:", err.message || err); + process.exit(1); +}); diff --git a/script/tron/deploy.ts b/script/tron/deploy.ts index 9593c98bc..757145e37 100644 --- a/script/tron/deploy.ts +++ b/script/tron/deploy.ts @@ -10,7 +10,7 @@ * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) * NODE_URL_728126428 — Tron mainnet full node URL * NODE_URL_3448148188 — Tron Nile testnet full node URL - * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * TRON_FEE_LIMIT — optional, in sun (default: 100000000 = 100 TRX) */ import "dotenv/config"; @@ -187,7 +187,7 @@ export async function deployContract(opts: { process.exit(1); } - const feeLimit = opts.feeLimit ?? parseInt(process.env.TRON_FEE_LIMIT || "1500000000", 10); + const feeLimit = opts.feeLimit ?? parseInt(process.env.TRON_FEE_LIMIT || "100000000", 10); // Create a TronWeb instance (private key set below after mnemonic derivation). const tronWeb = new TronWeb({ fullHost: fullNode }); diff --git a/script/tron/universal/tron-deploy-sp1-auto-verifier.ts b/script/tron/universal/tron-deploy-sp1-auto-verifier.ts index 1ae3d0d19..1f674c1a0 100644 --- a/script/tron/universal/tron-deploy-sp1-auto-verifier.ts +++ b/script/tron/universal/tron-deploy-sp1-auto-verifier.ts @@ -8,7 +8,7 @@ * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) * NODE_URL_728126428 — Tron mainnet full node URL * NODE_URL_3448148188 — Tron Nile testnet full node URL - * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * TRON_FEE_LIMIT — optional, in sun (default: 100000000 = 100 TRX) * * Options: * --testnet — deploy to Tron Nile testnet (default: mainnet) From a59792efb13c14c96a3da0c19194abdcd59096ea Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Thu, 2 Apr 2026 10:46:26 -0600 Subject: [PATCH 17/19] update comments on Tron Fee Limit default --- script/tron/universal/tron-deploy-sp1-helios.ts | 4 ++-- script/tron/universal/tron-deploy-universal-spokepool.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/tron/universal/tron-deploy-sp1-helios.ts b/script/tron/universal/tron-deploy-sp1-helios.ts index 9cfd8c88d..232af4909 100644 --- a/script/tron/universal/tron-deploy-sp1-helios.ts +++ b/script/tron/universal/tron-deploy-sp1-helios.ts @@ -13,7 +13,7 @@ * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) * NODE_URL_728126428 — Tron mainnet full node URL * NODE_URL_3448148188 — Tron Nile testnet full node URL - * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * TRON_FEE_LIMIT — optional, in sun (default: 100000000 = 100 TRX) * SP1_RELEASE_TRON — Genesis binary version (e.g. "0.1.0-alpha.20") * SP1_PROVER_MODE_TRON — SP1 prover type: "mock", "cpu", "cuda", or "network" * SP1_VERIFIER_ADDRESS_TRON — SP1 verifier contract address (Tron Base58Check, T...) @@ -23,7 +23,7 @@ * * Options: * --testnet — deploy to Tron Nile testnet (default: mainnet) - * --fee-limit — fee limit in sun (default: 1500000000 = 1500 TRX) + * --fee-limit — fee limit in sun (default: 100000000 = 100 TRX) * * Usage: * yarn tron-deploy-sp1-helios [--testnet] [--fee-limit ] diff --git a/script/tron/universal/tron-deploy-universal-spokepool.ts b/script/tron/universal/tron-deploy-universal-spokepool.ts index 4de888bc5..ee7a74053 100644 --- a/script/tron/universal/tron-deploy-universal-spokepool.ts +++ b/script/tron/universal/tron-deploy-universal-spokepool.ts @@ -9,7 +9,7 @@ * MNEMONIC — BIP-39 mnemonic (derives account 0 private key) * NODE_URL_728126428 — Tron mainnet full node URL * NODE_URL_3448148188 — Tron Nile testnet full node URL - * TRON_FEE_LIMIT — optional, in sun (default: 1500000000 = 1500 TRX) + * TRON_FEE_LIMIT — optional, in sun (default: 100000000 = 100 TRX) * * Options: * --testnet — deploy to Tron Nile testnet (default: mainnet) From 543d4af47b54c15404d7f010ea428a7fef719ade Mon Sep 17 00:00:00 2001 From: Taylor Webb Date: Thu, 2 Apr 2026 15:29:18 -0600 Subject: [PATCH 18/19] extract addresses --- broadcast/deployed-addresses.json | 5 ----- broadcast/deployed-addresses.md | 1 - 2 files changed, 6 deletions(-) diff --git a/broadcast/deployed-addresses.json b/broadcast/deployed-addresses.json index 205a55d1c..74c4ffbae 100644 --- a/broadcast/deployed-addresses.json +++ b/broadcast/deployed-addresses.json @@ -240,11 +240,6 @@ "block_number": 24421479, "transaction_hash": "0x0969ace8106c5b2b49d16acf429033531961704e89369e236eb903c2f371b206" }, - "Universal_Adapter_728126428": { - "address": "0xA1da1A70cc9F27F4aEDff1d515B1a0C47fb6c3Db", - "block_number": 24780350, - "transaction_hash": "0x42ee92932f8f746d6f215d895dc5462d492979bc5f10ca539bc1c8d3f7c6eabe" - }, "WithdrawImplementation": { "address": "0xbCc541C5AeD10843C75336c2d32D363Db6eCF351", "block_number": 24642482, diff --git a/broadcast/deployed-addresses.md b/broadcast/deployed-addresses.md index b927575cc..89232a397 100644 --- a/broadcast/deployed-addresses.md +++ b/broadcast/deployed-addresses.md @@ -55,7 +55,6 @@ This file contains the latest deployed smart contract addresses from the broadca | Universal_Adapter_143 | [0xC29a3Ba0fBf477F16Fd53d2C438Eade024FD8452](https://etherscan.io/address/0xC29a3Ba0fBf477F16Fd53d2C438Eade024FD8452) | | Universal_Adapter_4217 | [0x4577980eBFCC6fC8ff516aC06dA9e729c40cA57c](https://etherscan.io/address/0x4577980eBFCC6fC8ff516aC06dA9e729c40cA57c) | | Universal_Adapter_56 | [0x6f1C9d3bcDF51316E7b515a62C02F601500b084b](https://etherscan.io/address/0x6f1C9d3bcDF51316E7b515a62C02F601500b084b) | -| Universal_Adapter_728126428 | [0xA1da1A70cc9F27F4aEDff1d515B1a0C47fb6c3Db](https://etherscan.io/address/0xA1da1A70cc9F27F4aEDff1d515B1a0C47fb6c3Db) | | Universal_Adapter_9745 | [0xb47fD69FE25878F4E43aAF2F9ad7D0A3A0B22363](https://etherscan.io/address/0xb47fD69FE25878F4E43aAF2F9ad7D0A3A0B22363) | | Universal_Adapter_999 | [0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B](https://etherscan.io/address/0x0ec70777Ac388774041dD5A1778Cdf3AF3134D2B) | | WithdrawImplementation | [0xbCc541C5AeD10843C75336c2d32D363Db6eCF351](https://etherscan.io/address/0xbCc541C5AeD10843C75336c2d32D363Db6eCF351) | From fc6f2801c5a0bf7bb29d678698ac1e7a8c645deb Mon Sep 17 00:00:00 2001 From: Taylor Webb <84364476+tbwebb22@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:18:12 -0600 Subject: [PATCH 19/19] Apply suggestion from @bmzig Co-authored-by: bmzig <57361391+bmzig@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eafd5d535..d71f98681 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@across-protocol/contracts", - "version": "5.0.5-alpha.0", + "version": "5.0.5", "author": "UMA Team", "license": "AGPL-3.0-only", "repository": {