Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ docs/

# Dotenv file
.env

# Node modules
node_modules
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "usx-contracts",
"version": "1.0.0",
"main": "index.js",
"repository": "[email protected]:scroll-tech/usx-contracts.git",
"author": "zimpha <[email protected]>",
"license": "MIT",
"type": "module",
"devDependencies": {
"@types/node": "^24.10.1",
"dotenv": "^17.2.3",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
},
"dependencies": {
"axios": "^1.13.2",
"commander": "^14.0.2",
"viem": "^2.39.0"
}
}
350 changes: 350 additions & 0 deletions tools/abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,350 @@
export const ScrollL1MessengerABI = [
{
inputs: [
{ internalType: "address", name: "_counterpart", type: "address" },
{ internalType: "address", name: "_rollup", type: "address" },
{ internalType: "address", name: "_messageQueueV1", type: "address" },
{ internalType: "address", name: "_messageQueueV2", type: "address" },
{ internalType: "address", name: "_enforcedTxGateway", type: "address" },
],
stateMutability: "nonpayable",
type: "constructor",
},
{ inputs: [], name: "ErrorForbidToCallMessageQueue", type: "error" },
{ inputs: [], name: "ErrorZeroAddress", type: "error" },
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "messageHash",
type: "bytes32",
},
],
name: "FailedRelayedMessage",
type: "event",
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: "uint8", name: "version", type: "uint8" },
],
name: "Initialized",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "newOwner",
type: "address",
},
],
name: "OwnershipTransferred",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "account",
type: "address",
},
],
name: "Paused",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "messageHash",
type: "bytes32",
},
],
name: "RelayedMessage",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "target",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "value",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "messageNonce",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "gasLimit",
type: "uint256",
},
{ indexed: false, internalType: "bytes", name: "message", type: "bytes" },
],
name: "SentMessage",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "account",
type: "address",
},
],
name: "Unpaused",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "_oldFeeVault",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "_newFeeVault",
type: "address",
},
],
name: "UpdateFeeVault",
type: "event",
},
{
inputs: [],
name: "counterpart",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "enforcedTxGateway",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "feeVault",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "_counterpart", type: "address" },
{ internalType: "address", name: "_feeVault", type: "address" },
{ internalType: "address", name: "_rollup", type: "address" },
{ internalType: "address", name: "_messageQueue", type: "address" },
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
name: "isL2MessageExecuted",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "messageQueueV1",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "messageQueueV2",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
name: "messageSendTimestamp",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "paused",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function",
},
{
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
name: "prevReplayIndex",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "_from", type: "address" },
{ internalType: "address", name: "_to", type: "address" },
{ internalType: "uint256", name: "_value", type: "uint256" },
{ internalType: "uint256", name: "_nonce", type: "uint256" },
{ internalType: "bytes", name: "_message", type: "bytes" },
{
components: [
{ internalType: "uint256", name: "batchIndex", type: "uint256" },
{ internalType: "bytes", name: "merkleProof", type: "bytes" },
],
internalType: "struct IL1ScrollMessenger.L2MessageProof",
name: "_proof",
type: "tuple",
},
],
name: "relayMessageWithProof",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "_from", type: "address" },
{ internalType: "address", name: "_to", type: "address" },
{ internalType: "uint256", name: "_value", type: "uint256" },
{ internalType: "uint256", name: "_messageNonce", type: "uint256" },
{ internalType: "bytes", name: "_message", type: "bytes" },
{ internalType: "uint32", name: "_newGasLimit", type: "uint32" },
{ internalType: "address", name: "_refundAddress", type: "address" },
],
name: "replayMessage",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
name: "replayStates",
outputs: [
{ internalType: "uint128", name: "times", type: "uint128" },
{ internalType: "uint128", name: "lastIndex", type: "uint128" },
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "rollup",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "_to", type: "address" },
{ internalType: "uint256", name: "_value", type: "uint256" },
{ internalType: "bytes", name: "_message", type: "bytes" },
{ internalType: "uint256", name: "_gasLimit", type: "uint256" },
{ internalType: "address", name: "_refundAddress", type: "address" },
],
name: "sendMessage",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "_to", type: "address" },
{ internalType: "uint256", name: "_value", type: "uint256" },
{ internalType: "bytes", name: "_message", type: "bytes" },
{ internalType: "uint256", name: "_gasLimit", type: "uint256" },
],
name: "sendMessage",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [{ internalType: "bool", name: "_status", type: "bool" }],
name: "setPause",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{ internalType: "address", name: "_newFeeVault", type: "address" },
],
name: "updateFeeVault",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "xDomainMessageSender",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function",
},
{ stateMutability: "payable", type: "receive" },
];
Loading
Loading