Skip to content

Commit

Permalink
Merge pull request #281 from 0xPolygonHermez/support-new-api
Browse files Browse the repository at this point in the history
Add support for the new changes in the Bridge API
  • Loading branch information
elias-garcia authored Jan 18, 2024
2 parents 7c84791 + 7f59576 commit 617d49b
Show file tree
Hide file tree
Showing 13 changed files with 2,510 additions and 848 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ VITE_ETHEREUM_EXPLORER_URL=https://goerli.etherscan.io
VITE_ETHEREUM_BRIDGE_CONTRACT_ADDRESS=0x0165878A594ca255338adfa4d48449f69242Eb8F
VITE_ETHEREUM_FORCE_UPDATE_GLOBAL_EXIT_ROOT=true
VITE_ETHEREUM_PROOF_OF_EFFICIENCY_CONTRACT_ADDRESS=0x8dA3b8020401851438eEe8bB434c57b54999935c
VITE_ETHEREUM_ROLLUP_MANAGER_ADDRESS=0xe40DF1be0d6C310Fb549059E43caf211f13dEB47

# POLYGON ZK EVM
VITE_POLYGON_ZK_EVM_RPC_URL=http://localhost:8123
Expand Down
239 changes: 223 additions & 16 deletions abis/bridge.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"name": "EtherTransferFailed",
"type": "error"
},
{
"inputs": [],
"name": "GasTokenNetworkMustBeZeroOnEther",
"type": "error"
},
{
"inputs": [],
"name": "GlobalExitRootInvalid",
Expand All @@ -44,6 +49,16 @@
"name": "MsgValueNotZero",
"type": "error"
},
{
"inputs": [],
"name": "NativeTokenIsEther",
"type": "error"
},
{
"inputs": [],
"name": "NoValueInMessagesOnGasTokenNetworks",
"type": "error"
},
{
"inputs": [],
"name": "NotValidAmount",
Expand Down Expand Up @@ -76,7 +91,7 @@
},
{
"inputs": [],
"name": "OnlyPolygonZkEVM",
"name": "OnlyRollupManager",
"type": "error"
},
{
Expand Down Expand Up @@ -139,9 +154,9 @@
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "index",
"type": "uint32"
"internalType": "uint256",
"name": "globalIndex",
"type": "uint256"
},
{
"indexed": false,
Expand Down Expand Up @@ -227,6 +242,19 @@
"name": "NewWrappedToken",
"type": "event"
},
{
"inputs": [],
"name": "WETHToken",
"outputs": [
{
"internalType": "contract TokenWrapped",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "activateEmergencyState",
Expand Down Expand Up @@ -302,6 +330,44 @@
},
{
"inputs": [
{
"internalType": "uint32",
"name": "destinationNetwork",
"type": "uint32"
},
{
"internalType": "address",
"name": "destinationAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountWETH",
"type": "uint256"
},
{
"internalType": "bool",
"name": "forceUpdateGlobalExitRoot",
"type": "bool"
},
{
"internalType": "bytes",
"name": "metadata",
"type": "bytes"
}
],
"name": "bridgeMessageWETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "leafHash",
"type": "bytes32"
},
{
"internalType": "bytes32[32]",
"name": "smtProof",
Expand All @@ -311,6 +377,64 @@
"internalType": "uint32",
"name": "index",
"type": "uint32"
}
],
"name": "calculateRoot",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "originNetwork",
"type": "uint32"
},
{
"internalType": "address",
"name": "originTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "calculateTokenWrapperAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32[32]",
"name": "smtProofLocalExitRoot",
"type": "bytes32[32]"
},
{
"internalType": "bytes32[32]",
"name": "smtProofRollupExitRoot",
"type": "bytes32[32]"
},
{
"internalType": "uint256",
"name": "globalIndex",
"type": "uint256"
},
{
"internalType": "bytes32",
Expand Down Expand Up @@ -362,13 +486,18 @@
"inputs": [
{
"internalType": "bytes32[32]",
"name": "smtProof",
"name": "smtProofLocalExitRoot",
"type": "bytes32[32]"
},
{
"internalType": "uint32",
"name": "index",
"type": "uint32"
"internalType": "bytes32[32]",
"name": "smtProofRollupExitRoot",
"type": "bytes32[32]"
},
{
"internalType": "uint256",
"name": "globalIndex",
"type": "uint256"
},
{
"internalType": "bytes32",
Expand Down Expand Up @@ -457,12 +586,38 @@
},
{
"inputs": [],
"name": "getDepositRoot",
"name": "gasTokenAddress",
"outputs": [
{
"internalType": "bytes32",
"internalType": "address",
"name": "",
"type": "bytes32"
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gasTokenMetadata",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gasTokenNetwork",
"outputs": [
{
"internalType": "uint32",
"name": "",
"type": "uint32"
}
],
"stateMutability": "view",
Expand Down Expand Up @@ -517,6 +672,38 @@
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "getRoot",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "getTokenMetadata",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -561,15 +748,30 @@
"name": "_networkID",
"type": "uint32"
},
{
"internalType": "address",
"name": "_gasTokenAddress",
"type": "address"
},
{
"internalType": "uint32",
"name": "_gasTokenNetwork",
"type": "uint32"
},
{
"internalType": "contract IBasePolygonZkEVMGlobalExitRoot",
"name": "_globalExitRootManager",
"type": "address"
},
{
"internalType": "address",
"name": "_polygonZkEVMaddress",
"name": "_polygonRollupManager",
"type": "address"
},
{
"internalType": "bytes",
"name": "_gasTokenMetadata",
"type": "bytes"
}
],
"name": "initialize",
Expand All @@ -580,9 +782,14 @@
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
"internalType": "uint32",
"name": "leafIndex",
"type": "uint32"
},
{
"internalType": "uint32",
"name": "sourceBridgeNetwork",
"type": "uint32"
}
],
"name": "isClaimed",
Expand Down Expand Up @@ -637,7 +844,7 @@
},
{
"inputs": [],
"name": "polygonZkEVMaddress",
"name": "polygonRollupManager",
"outputs": [
{
"internalType": "address",
Expand Down
Loading

0 comments on commit 617d49b

Please sign in to comment.