From 20c0c2332654b6778c19999fd9c8748c154feee8 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Tue, 10 Dec 2024 15:59:28 +0200 Subject: [PATCH] Renamed bridge. --- .../bridge/001_deploy_bridge.ts | 6 +- .../testing/004_token_withdrawal.ts | 4 +- .../testnet/layer1/002_add_bridge_admin.ts | 6 +- .../testnet/layer2/001_whitelist_tokens.ts | 4 +- contracts/generated/TenBridge/TenBridge.go | 1292 +++++++++++++++++ ...uroBridgeAdmin.sol => ITenBridgeAdmin.sol} | 2 +- .../L1/{ObscuroBridge.sol => TenBridge.sol} | 10 +- contracts/test/bridge-test.ts | 6 +- 8 files changed, 1312 insertions(+), 18 deletions(-) create mode 100644 contracts/generated/TenBridge/TenBridge.go rename contracts/src/bridge/L1/{IObscuroBridgeAdmin.sol => ITenBridgeAdmin.sol} (95%) rename contracts/src/bridge/L1/{ObscuroBridge.sol => TenBridge.sol} (94%) diff --git a/contracts/deployment_scripts/bridge/001_deploy_bridge.ts b/contracts/deployment_scripts/bridge/001_deploy_bridge.ts index 07198386e0..1f899e1bba 100644 --- a/contracts/deployment_scripts/bridge/001_deploy_bridge.ts +++ b/contracts/deployment_scripts/bridge/001_deploy_bridge.ts @@ -27,7 +27,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const messengerL1 = await hre.companionNetworks.layer1.deployments.get("CrossChainMessenger"); // We deploy the layer 1 part of the bridge. - const layer1BridgeDeployment = await hre.companionNetworks.layer1.deployments.deploy('ObscuroBridge', { + const layer1BridgeDeployment = await hre.companionNetworks.layer1.deployments.deploy('TenBridge', { from: accountsL1.deployer, log: true, proxy: { @@ -61,7 +61,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const messengerL2 = await deployments.get("CrossChainMessenger"); // Deploy the layer 2 part of the bridge and instruct it to use the address of the L2 cross chain messenger to enable functionality - // and be subordinate of the L1 ObscuroBridge + // and be subordinate of the L1 TenBridge const layer2BridgeDeployment = await deployments.deploy('EthereumBridge', { from: accountsL2.deployer, log: true, @@ -76,7 +76,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } }); - await hre.companionNetworks.layer1.deployments.execute("ObscuroBridge", { + await hre.companionNetworks.layer1.deployments.execute("TenBridge", { from: accountsL1.deployer, log: true, }, "setRemoteBridge", layer2BridgeDeployment.address); diff --git a/contracts/deployment_scripts/testing/004_token_withdrawal.ts b/contracts/deployment_scripts/testing/004_token_withdrawal.ts index b0b09aa54c..60d22ebcbb 100644 --- a/contracts/deployment_scripts/testing/004_token_withdrawal.ts +++ b/contracts/deployment_scripts/testing/004_token_withdrawal.ts @@ -55,7 +55,7 @@ async function bridgeTokenToL2(hre: HardhatRuntimeEnvironment, amount: string) { const deployerL2 = (await hre.getNamedAccounts()).deployer; const token = await l1Network.deployments.get("HOCERC20"); console.log(`Token address = ${token.address}`); - const tenBridge = await l1Network.deployments.get("ObscuroBridge"); + const tenBridge = await l1Network.deployments.get("TenBridge"); const l1Provider = new HardhatEthersProvider(l1Network.provider, "layer1") const signer = await l1Provider.getSigner(deployerL1); @@ -69,7 +69,7 @@ async function bridgeTokenToL2(hre: HardhatRuntimeEnvironment, amount: string) { console.log(`Token approval successful for l1 to l2`); } { - const tenBridgeContract = await hre.ethers.getContractAt("ObscuroBridge", tenBridge.address, signer); + const tenBridgeContract = await hre.ethers.getContractAt("TenBridge", tenBridge.address, signer); const bridgeTx = await tenBridgeContract.sendERC20(token.address, amount, deployerL2!); const receipt = await bridgeTx.wait(); if (receipt!.status !== 1) { diff --git a/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts b/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts index 2fdab0fba0..abfeda87a3 100644 --- a/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts +++ b/contracts/deployment_scripts/testnet/layer1/002_add_bridge_admin.ts @@ -16,15 +16,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployer} = await getNamedAccounts(); // Deploy a constant supply (constructor mints) erc20 - await deployments.execute('ObscuroBridge', { + await deployments.execute('TenBridge', { from: deployer }, 'promoteToAdmin', '0xE09a37ABc1A63441404007019E5BC7517bE2c43f'); - await deployments.execute('ObscuroBridge', { + await deployments.execute('TenBridge', { from: deployer }, 'promoteToAdmin', '0xeC3f9B38a3B30AdC9fB3dF3a0D8f50127E6c2C8f'); }; export default func; func.tags = ['BRIDGEADMIN', 'BRIDGEADMIN_deploy']; -func.dependencies = ['ObscuroBridge'] +func.dependencies = ['TenBridge'] diff --git a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts index c831f99bb3..c5c5ac9c5a 100644 --- a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts +++ b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts @@ -36,7 +36,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { console.log(`Loaded message bus address = ${l2messageBusAddress}`); // Tell the bridge to whitelist the address of HOC token. This generates a cross chain message. - let hocResult = await l1Network.deployments.execute("ObscuroBridge", { + let hocResult = await l1Network.deployments.execute("TenBridge", { from: l1Accounts.deployer, log: true, }, "whitelistToken", HOCDeployment.address, "HOC", "HOC"); @@ -47,7 +47,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } // Tell the bridge to whitelist POC. This also generates a cross chain message. - const pocResult = await l1Network.deployments.execute("ObscuroBridge", { + const pocResult = await l1Network.deployments.execute("TenBridge", { from: l1Accounts.deployer, log: true, }, "whitelistToken", POCDeployment.address, "POC", "POC"); diff --git a/contracts/generated/TenBridge/TenBridge.go b/contracts/generated/TenBridge/TenBridge.go new file mode 100644 index 0000000000..61ef43ddb6 --- /dev/null +++ b/contracts/generated/TenBridge/TenBridge.go @@ -0,0 +1,1292 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package TenBridge + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// TenBridgeMetaData contains all meta data concerning the TenBridge contract. +var TenBridgeMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ERC20_TOKEN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NATIVE_TOKEN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"messengerAddress\",\"type\":\"address\"}],\"name\":\"configure\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"messenger\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"promoteToAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"receiveAssets\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"removeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"sendERC20\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"sendNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridge\",\"type\":\"address\"}],\"name\":\"setRemoteBridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"whitelistToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + Bin: "0x60806040526001805463ffffffff60a01b19169055348015601f57600080fd5b50611b698061002f6000396000f3fe6080604052600436106101445760003560e01c806375b238fc116100c0578063a217fddf11610074578063c4d66de811610059578063c4d66de8146103a7578063d547741f146103c7578063e4c3ebc7146103e757600080fd5b8063a217fddf1461037f578063a381c8e21461039457600080fd5b806383bece4d116100a557806383bece4d146102f957806391d148541461031957806393b374421461035f57600080fd5b806375b238fc146102a557806375cb2672146102d957600080fd5b80632f2ff15d11610117578063498d82ab116100fc578063498d82ab146102315780635d872970146102515780635fa7b5841461028557600080fd5b80632f2ff15d146101f157806336568abe1461021157600080fd5b806301ffc9a71461014957806316ce81491461017f5780631888d712146101a1578063248a9ca3146101b4575b600080fd5b34801561015557600080fd5b50610169610164366004611320565b61041b565b6040516101769190611349565b60405180910390f35b34801561018b57600080fd5b5061019f61019a36600461137c565b610484565b005b61019f6101af36600461137c565b6104de565b3480156101c057600080fd5b506101e46101cf3660046113ac565b60009081526002602052604090206001015490565b60405161017691906113d1565b3480156101fd57600080fd5b5061019f61020c3660046113df565b6105eb565b34801561021d57600080fd5b5061019f61022c3660046113df565b610616565b34801561023d57600080fd5b5061019f61024c366004611469565b610667565b34801561025d57600080fd5b506101e47f9f225881f6e7ac8a885b63aa2269cbce78dd6a669864ccd2cd2517a8e709d73a81565b34801561029157600080fd5b5061019f6102a036600461137c565b61072c565b3480156102b157600080fd5b506101e47fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b3480156102e557600080fd5b5061019f6102f436600461137c565b610780565b34801561030557600080fd5b5061019f6103143660046114f6565b61085b565b34801561032557600080fd5b506101696103343660046113df565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561036b57600080fd5b5061019f61037a36600461137c565b610975565b34801561038b57600080fd5b506101e4600081565b61019f6103a23660046114f6565b6109c9565b3480156103b357600080fd5b5061019f6103c236600461137c565b610ab8565b3480156103d357600080fd5b5061019f6103e23660046113df565b610c51565b3480156103f357600080fd5b506101e47fd2fb17ceaa388942529b17e0006ffc4d559f040dd4f2157b8070f17ad211057881565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061047e57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217756104ae81610c76565b506003805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600034116105075760405162461bcd60e51b81526004016104fe90611573565b60405180910390fd5b60006040518060400160405280348152602001836001600160a01b031681525060405160200161053791906115ab565b60408051601f19818403018152919052600354909150610568906001600160a01b03168260025b6000806000610c83565b6001546040517f346633fb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063346633fb9034906105b590869083906004016115b9565b6000604051808303818588803b1580156105ce57600080fd5b505af11580156105e2573d6000803e3d6000fd5b50505050505050565b60008281526002602052604090206001015461060681610c76565b6106108383610d9a565b50505050565b6001600160a01b0381163314610658576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106628282610e48565b505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561069181610c76565b6106bb7f9f225881f6e7ac8a885b63aa2269cbce78dd6a669864ccd2cd2517a8e709d73a87610d9a565b50600063458ffd6360e01b87878787876040516024016106df959493929190611600565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526003549091506105e2906001600160a01b031682600161055e565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561075681610c76565b6106627f9f225881f6e7ac8a885b63aa2269cbce78dd6a669864ccd2cd2517a8e709d73a83610e48565b610788610ecf565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155604080517fa1a227fa000000000000000000000000000000000000000000000000000000008152905163a1a227fa916004808201926020929091908290030181865afa158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b919061164c565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905550565b6003546000546001600160a01b039182169116331461088c5760405162461bcd60e51b81526004016104fe906116c5565b806001600160a01b031661089e610f38565b6001600160a01b0316146108c45760405162461bcd60e51b81526004016104fe9061172d565b6001600160a01b03841660009081527f32ef73018533fa188e9e42b313c0a4048c6052342b662fb7510c0d1abcea3413602052604090205460ff16156109145761090f848484610fb5565b610610565b6001600160a01b03841660009081527f13ad2d85210d477fe1a6e25654c8250308cf29b050a4bf0b039d70467486712c602052604090205460ff161561095d5761090f82610fc0565b60405162461bcd60e51b81526004016104fe90611795565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561099f81610c76565b6106627fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177583610d9a565b600082116109e95760405162461bcd60e51b81526004016104fe906117d7565b6001600160a01b03831660009081527f32ef73018533fa188e9e42b313c0a4048c6052342b662fb7510c0d1abcea3413602052604090205460ff16610a405760405162461bcd60e51b81526004016104fe906117e7565b610a4c83333085611032565b60006383bece4d60e01b848484604051602401610a6b9392919061186e565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152600354909150610610906001600160a01b031682600061055e565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015610b035750825b905060008267ffffffffffffffff166001148015610b205750303b155b905081158015610b2e575080155b15610b65576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610b9957845468ff00000000000000001916680100000000000000001785555b610ba286610780565b610bcc7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533610d9a565b50610bf87fd2fb17ceaa388942529b17e0006ffc4d559f040dd4f2157b8070f17ad21105786000610d9a565b508315610c4957845468ff0000000000000000191685556040517fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290610c40906001906118b9565b60405180910390a15b505050505050565b600082815260026020526040902060010154610c6c81610c76565b6106108383610e48565b610c80813361108c565b50565b60006040518060600160405280886001600160a01b0316815260200187815260200185815250604051602001610cb99190611966565b60408051808303601f19018152919052600180549192506001600160a01b0382169163b1454caa91859174010000000000000000000000000000000000000000900463ffffffff16906014610d0d836119a6565b91906101000a81548163ffffffff021916908363ffffffff1602179055508885886040518663ffffffff1660e01b8152600401610d4d94939291906119de565b60206040518083038185885af1158015610d6b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d909190611a3e565b5050505050505050565b60008281526002602090815260408083206001600160a01b038516845290915281205460ff16610e405760008381526002602090815260408083206001600160a01b03861684529091529020805460ff19166001179055610df83390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161047e565b50600061047e565b60008281526002602090815260408083206001600160a01b038516845290915281205460ff1615610e405760008381526002602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161047e565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16610f36576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b60008060009054906101000a90046001600160a01b03166001600160a01b03166363012de56040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb0919061164c565b905090565b6106628382846110ec565b6040516000906001600160a01b038316908281818181865af19150503d8060008114611008576040519150601f19603f3d011682016040523d82523d6000602084013e61100d565b606091505b505090508061102e5760405162461bcd60e51b81526004016104fe90611a8f565b5050565b61061084856001600160a01b03166323b872dd86868660405160240161105a93929190611a9f565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611112565b60008281526002602090815260408083206001600160a01b038516845290915290205460ff1661102e5780826040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526004016104fe9291906115b9565b61066283846001600160a01b031663a9059cbb858560405160240161105a9291906115b9565b60006111276001600160a01b03841683611185565b9050805160001415801561114c57508080602001905181019061114a9190611ada565b155b1561066257826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016104fe9190611af9565b60606111938383600061119a565b9392505050565b6060814710156111d857306040517fcd7860590000000000000000000000000000000000000000000000000000000081526004016104fe9190611af9565b600080856001600160a01b031684866040516111f49190611b29565b60006040518083038185875af1925050503d8060008114611231576040519150601f19603f3d011682016040523d82523d6000602084013e611236565b606091505b5091509150611246868383611250565b9695505050505050565b60608261126557611260826112bc565b611193565b815115801561127c57506001600160a01b0384163b155b156112b557836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016104fe9190611af9565b5080611193565b8051156112cc5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160e01b031981165b8114610c8057600080fd5b803561047e816112fe565b60006020828403121561133557611335600080fd5b6111938383611315565b8015155b82525050565b6020810161047e828461133f565b60006001600160a01b03821661047e565b61130a81611357565b803561047e81611368565b60006020828403121561139157611391600080fd5b6111938383611371565b8061130a565b803561047e8161139b565b6000602082840312156113c1576113c1600080fd5b61119383836113a1565b80611343565b6020810161047e82846113cb565b600080604083850312156113f5576113f5600080fd5b6113ff84846113a1565b915061140e8460208501611371565b90509250929050565b60008083601f84011261142c5761142c600080fd5b50813567ffffffffffffffff81111561144757611447600080fd5b60208301915083600182028301111561146257611462600080fd5b9250929050565b60008060008060006060868803121561148457611484600080fd5b61148e8787611371565b9450602086013567ffffffffffffffff8111156114ad576114ad600080fd5b6114b988828901611417565b9450945050604086013567ffffffffffffffff8111156114db576114db600080fd5b6114e788828901611417565b92509250509295509295909350565b60008060006060848603121561150e5761150e600080fd5b6115188585611371565b925061152785602086016113a1565b91506115368560408601611371565b90509250925092565b600f8152602081017f456d707479207472616e736665722e0000000000000000000000000000000000815290505b60200190565b6020808252810161047e8161153f565b61134381611357565b805161159883826113cb565b5060208101516106626020840182611583565b6040810161047e828461158c565b604081016115c78285611583565b61119360208301846113cb565b82818337506000910152565b8183526020830192506115f48284836115d4565b50601f01601f19160190565b6060810161160e8288611583565b81810360208301526116218186886115e0565b905081810360408301526116368184866115e0565b979650505050505050565b805161047e81611368565b60006020828403121561166157611661600080fd5b6111938383611641565b60308152602081017f436f6e74726163742063616c6c6572206973206e6f742074686520726567697381527f7465726564206d657373656e6765722100000000000000000000000000000000602082015290505b60400190565b6020808252810161047e8161166b565b60318152602081017f43726f737320636861696e206d65737361676520636f6d696e672066726f6d2081527f696e636f72726563742073656e64657221000000000000000000000000000000602082015290506116bf565b6020808252810161047e816116d5565b60258152602081017f417474656d7074696e6720746f20776974686472617720756e6b6e6f776e206181527f737365742e000000000000000000000000000000000000000000000000000000602082015290506116bf565b6020808252810161047e8161173d565b601a8152602081017f417474656d7074696e6720656d707479207472616e736665722e0000000000008152905061156d565b6020808252810161047e816117a5565b6020808252810161047e81604e81527f54686973206164647265737320686173206e6f74206265656e20676976656e2060208201527f61207479706520616e64206973207468757320636f6e73696465726564206e6f60408201527f742077686974656c69737465642e000000000000000000000000000000000000606082015260800190565b6060810161187c8286611583565b61188960208301856113cb565b6118966040830184611583565b949350505050565b600067ffffffffffffffff821661047e565b6113438161189e565b6020810161047e82846118b0565b60005b838110156118e25781810151838201526020016118ca565b50506000910152565b60006118f5825190565b80845260208401935061190c8185602086016118c7565b601f01601f19169290920192915050565b805160009060608401906119318582611583565b506020830151848203602086015261194982826118eb565b915050604083015161195e60408601826113cb565b509392505050565b60208082528101611193818461191d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b63ffffffff16600063fffffffe1982016119c2576119c2611977565b5060010190565b63ffffffff8116611343565b60ff8116611343565b608081016119ec82876119c9565b6119f960208301866119c9565b8181036040830152611a0b81856118eb565b9050611a1a60608301846119d5565b95945050505050565b67ffffffffffffffff811661130a565b805161047e81611a23565b600060208284031215611a5357611a53600080fd5b6111938383611a33565b60148152602081017f4661696c656420746f2073656e642045746865720000000000000000000000008152905061156d565b6020808252810161047e81611a5d565b60608101611aad8286611583565b611aba6020830185611583565b61189660408301846113cb565b80151561130a565b805161047e81611ac7565b600060208284031215611aef57611aef600080fd5b6111938383611acf565b6020810161047e8284611583565b6000611b11825190565b611b1f8185602086016118c7565b9290920192915050565b61047e8183611b0756fea26469706673582212206c541bcdb236e303855ef96214365580066e027f9773c043f4897627bdbfa07564736f6c634300081c0033", +} + +// TenBridgeABI is the input ABI used to generate the binding from. +// Deprecated: Use TenBridgeMetaData.ABI instead. +var TenBridgeABI = TenBridgeMetaData.ABI + +// TenBridgeBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use TenBridgeMetaData.Bin instead. +var TenBridgeBin = TenBridgeMetaData.Bin + +// DeployTenBridge deploys a new Ethereum contract, binding an instance of TenBridge to it. +func DeployTenBridge(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *TenBridge, error) { + parsed, err := TenBridgeMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(TenBridgeBin), backend) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &TenBridge{TenBridgeCaller: TenBridgeCaller{contract: contract}, TenBridgeTransactor: TenBridgeTransactor{contract: contract}, TenBridgeFilterer: TenBridgeFilterer{contract: contract}}, nil +} + +// TenBridge is an auto generated Go binding around an Ethereum contract. +type TenBridge struct { + TenBridgeCaller // Read-only binding to the contract + TenBridgeTransactor // Write-only binding to the contract + TenBridgeFilterer // Log filterer for contract events +} + +// TenBridgeCaller is an auto generated read-only Go binding around an Ethereum contract. +type TenBridgeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TenBridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TenBridgeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TenBridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TenBridgeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TenBridgeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TenBridgeSession struct { + Contract *TenBridge // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TenBridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TenBridgeCallerSession struct { + Contract *TenBridgeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TenBridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TenBridgeTransactorSession struct { + Contract *TenBridgeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TenBridgeRaw is an auto generated low-level Go binding around an Ethereum contract. +type TenBridgeRaw struct { + Contract *TenBridge // Generic contract binding to access the raw methods on +} + +// TenBridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TenBridgeCallerRaw struct { + Contract *TenBridgeCaller // Generic read-only contract binding to access the raw methods on +} + +// TenBridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TenBridgeTransactorRaw struct { + Contract *TenBridgeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTenBridge creates a new instance of TenBridge, bound to a specific deployed contract. +func NewTenBridge(address common.Address, backend bind.ContractBackend) (*TenBridge, error) { + contract, err := bindTenBridge(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TenBridge{TenBridgeCaller: TenBridgeCaller{contract: contract}, TenBridgeTransactor: TenBridgeTransactor{contract: contract}, TenBridgeFilterer: TenBridgeFilterer{contract: contract}}, nil +} + +// NewTenBridgeCaller creates a new read-only instance of TenBridge, bound to a specific deployed contract. +func NewTenBridgeCaller(address common.Address, caller bind.ContractCaller) (*TenBridgeCaller, error) { + contract, err := bindTenBridge(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TenBridgeCaller{contract: contract}, nil +} + +// NewTenBridgeTransactor creates a new write-only instance of TenBridge, bound to a specific deployed contract. +func NewTenBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*TenBridgeTransactor, error) { + contract, err := bindTenBridge(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TenBridgeTransactor{contract: contract}, nil +} + +// NewTenBridgeFilterer creates a new log filterer instance of TenBridge, bound to a specific deployed contract. +func NewTenBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*TenBridgeFilterer, error) { + contract, err := bindTenBridge(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TenBridgeFilterer{contract: contract}, nil +} + +// bindTenBridge binds a generic wrapper to an already deployed contract. +func bindTenBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TenBridgeMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TenBridge *TenBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TenBridge.Contract.TenBridgeCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TenBridge *TenBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TenBridge.Contract.TenBridgeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TenBridge *TenBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TenBridge.Contract.TenBridgeTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TenBridge *TenBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TenBridge.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TenBridge *TenBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TenBridge.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TenBridge *TenBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TenBridge.Contract.contract.Transact(opts, method, params...) +} + +// ADMINROLE is a free data retrieval call binding the contract method 0x75b238fc. +// +// Solidity: function ADMIN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCaller) ADMINROLE(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "ADMIN_ROLE") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ADMINROLE is a free data retrieval call binding the contract method 0x75b238fc. +// +// Solidity: function ADMIN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeSession) ADMINROLE() ([32]byte, error) { + return _TenBridge.Contract.ADMINROLE(&_TenBridge.CallOpts) +} + +// ADMINROLE is a free data retrieval call binding the contract method 0x75b238fc. +// +// Solidity: function ADMIN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCallerSession) ADMINROLE() ([32]byte, error) { + return _TenBridge.Contract.ADMINROLE(&_TenBridge.CallOpts) +} + +// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. +// +// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCaller) DEFAULTADMINROLE(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "DEFAULT_ADMIN_ROLE") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. +// +// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeSession) DEFAULTADMINROLE() ([32]byte, error) { + return _TenBridge.Contract.DEFAULTADMINROLE(&_TenBridge.CallOpts) +} + +// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. +// +// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCallerSession) DEFAULTADMINROLE() ([32]byte, error) { + return _TenBridge.Contract.DEFAULTADMINROLE(&_TenBridge.CallOpts) +} + +// ERC20TOKENROLE is a free data retrieval call binding the contract method 0x5d872970. +// +// Solidity: function ERC20_TOKEN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCaller) ERC20TOKENROLE(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "ERC20_TOKEN_ROLE") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ERC20TOKENROLE is a free data retrieval call binding the contract method 0x5d872970. +// +// Solidity: function ERC20_TOKEN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeSession) ERC20TOKENROLE() ([32]byte, error) { + return _TenBridge.Contract.ERC20TOKENROLE(&_TenBridge.CallOpts) +} + +// ERC20TOKENROLE is a free data retrieval call binding the contract method 0x5d872970. +// +// Solidity: function ERC20_TOKEN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCallerSession) ERC20TOKENROLE() ([32]byte, error) { + return _TenBridge.Contract.ERC20TOKENROLE(&_TenBridge.CallOpts) +} + +// NATIVETOKENROLE is a free data retrieval call binding the contract method 0xe4c3ebc7. +// +// Solidity: function NATIVE_TOKEN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCaller) NATIVETOKENROLE(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "NATIVE_TOKEN_ROLE") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// NATIVETOKENROLE is a free data retrieval call binding the contract method 0xe4c3ebc7. +// +// Solidity: function NATIVE_TOKEN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeSession) NATIVETOKENROLE() ([32]byte, error) { + return _TenBridge.Contract.NATIVETOKENROLE(&_TenBridge.CallOpts) +} + +// NATIVETOKENROLE is a free data retrieval call binding the contract method 0xe4c3ebc7. +// +// Solidity: function NATIVE_TOKEN_ROLE() view returns(bytes32) +func (_TenBridge *TenBridgeCallerSession) NATIVETOKENROLE() ([32]byte, error) { + return _TenBridge.Contract.NATIVETOKENROLE(&_TenBridge.CallOpts) +} + +// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. +// +// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) +func (_TenBridge *TenBridgeCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "getRoleAdmin", role) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. +// +// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) +func (_TenBridge *TenBridgeSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { + return _TenBridge.Contract.GetRoleAdmin(&_TenBridge.CallOpts, role) +} + +// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. +// +// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) +func (_TenBridge *TenBridgeCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { + return _TenBridge.Contract.GetRoleAdmin(&_TenBridge.CallOpts, role) +} + +// HasRole is a free data retrieval call binding the contract method 0x91d14854. +// +// Solidity: function hasRole(bytes32 role, address account) view returns(bool) +func (_TenBridge *TenBridgeCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "hasRole", role, account) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// HasRole is a free data retrieval call binding the contract method 0x91d14854. +// +// Solidity: function hasRole(bytes32 role, address account) view returns(bool) +func (_TenBridge *TenBridgeSession) HasRole(role [32]byte, account common.Address) (bool, error) { + return _TenBridge.Contract.HasRole(&_TenBridge.CallOpts, role, account) +} + +// HasRole is a free data retrieval call binding the contract method 0x91d14854. +// +// Solidity: function hasRole(bytes32 role, address account) view returns(bool) +func (_TenBridge *TenBridgeCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { + return _TenBridge.Contract.HasRole(&_TenBridge.CallOpts, role, account) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_TenBridge *TenBridgeCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _TenBridge.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_TenBridge *TenBridgeSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _TenBridge.Contract.SupportsInterface(&_TenBridge.CallOpts, interfaceId) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_TenBridge *TenBridgeCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _TenBridge.Contract.SupportsInterface(&_TenBridge.CallOpts, interfaceId) +} + +// Configure is a paid mutator transaction binding the contract method 0x75cb2672. +// +// Solidity: function configure(address messengerAddress) returns() +func (_TenBridge *TenBridgeTransactor) Configure(opts *bind.TransactOpts, messengerAddress common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "configure", messengerAddress) +} + +// Configure is a paid mutator transaction binding the contract method 0x75cb2672. +// +// Solidity: function configure(address messengerAddress) returns() +func (_TenBridge *TenBridgeSession) Configure(messengerAddress common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.Configure(&_TenBridge.TransactOpts, messengerAddress) +} + +// Configure is a paid mutator transaction binding the contract method 0x75cb2672. +// +// Solidity: function configure(address messengerAddress) returns() +func (_TenBridge *TenBridgeTransactorSession) Configure(messengerAddress common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.Configure(&_TenBridge.TransactOpts, messengerAddress) +} + +// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. +// +// Solidity: function grantRole(bytes32 role, address account) returns() +func (_TenBridge *TenBridgeTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "grantRole", role, account) +} + +// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. +// +// Solidity: function grantRole(bytes32 role, address account) returns() +func (_TenBridge *TenBridgeSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.GrantRole(&_TenBridge.TransactOpts, role, account) +} + +// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. +// +// Solidity: function grantRole(bytes32 role, address account) returns() +func (_TenBridge *TenBridgeTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.GrantRole(&_TenBridge.TransactOpts, role, account) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address messenger) returns() +func (_TenBridge *TenBridgeTransactor) Initialize(opts *bind.TransactOpts, messenger common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "initialize", messenger) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address messenger) returns() +func (_TenBridge *TenBridgeSession) Initialize(messenger common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.Initialize(&_TenBridge.TransactOpts, messenger) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address messenger) returns() +func (_TenBridge *TenBridgeTransactorSession) Initialize(messenger common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.Initialize(&_TenBridge.TransactOpts, messenger) +} + +// PromoteToAdmin is a paid mutator transaction binding the contract method 0x93b37442. +// +// Solidity: function promoteToAdmin(address newAdmin) returns() +func (_TenBridge *TenBridgeTransactor) PromoteToAdmin(opts *bind.TransactOpts, newAdmin common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "promoteToAdmin", newAdmin) +} + +// PromoteToAdmin is a paid mutator transaction binding the contract method 0x93b37442. +// +// Solidity: function promoteToAdmin(address newAdmin) returns() +func (_TenBridge *TenBridgeSession) PromoteToAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.PromoteToAdmin(&_TenBridge.TransactOpts, newAdmin) +} + +// PromoteToAdmin is a paid mutator transaction binding the contract method 0x93b37442. +// +// Solidity: function promoteToAdmin(address newAdmin) returns() +func (_TenBridge *TenBridgeTransactorSession) PromoteToAdmin(newAdmin common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.PromoteToAdmin(&_TenBridge.TransactOpts, newAdmin) +} + +// ReceiveAssets is a paid mutator transaction binding the contract method 0x83bece4d. +// +// Solidity: function receiveAssets(address asset, uint256 amount, address receiver) returns() +func (_TenBridge *TenBridgeTransactor) ReceiveAssets(opts *bind.TransactOpts, asset common.Address, amount *big.Int, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "receiveAssets", asset, amount, receiver) +} + +// ReceiveAssets is a paid mutator transaction binding the contract method 0x83bece4d. +// +// Solidity: function receiveAssets(address asset, uint256 amount, address receiver) returns() +func (_TenBridge *TenBridgeSession) ReceiveAssets(asset common.Address, amount *big.Int, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.ReceiveAssets(&_TenBridge.TransactOpts, asset, amount, receiver) +} + +// ReceiveAssets is a paid mutator transaction binding the contract method 0x83bece4d. +// +// Solidity: function receiveAssets(address asset, uint256 amount, address receiver) returns() +func (_TenBridge *TenBridgeTransactorSession) ReceiveAssets(asset common.Address, amount *big.Int, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.ReceiveAssets(&_TenBridge.TransactOpts, asset, amount, receiver) +} + +// RemoveToken is a paid mutator transaction binding the contract method 0x5fa7b584. +// +// Solidity: function removeToken(address asset) returns() +func (_TenBridge *TenBridgeTransactor) RemoveToken(opts *bind.TransactOpts, asset common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "removeToken", asset) +} + +// RemoveToken is a paid mutator transaction binding the contract method 0x5fa7b584. +// +// Solidity: function removeToken(address asset) returns() +func (_TenBridge *TenBridgeSession) RemoveToken(asset common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.RemoveToken(&_TenBridge.TransactOpts, asset) +} + +// RemoveToken is a paid mutator transaction binding the contract method 0x5fa7b584. +// +// Solidity: function removeToken(address asset) returns() +func (_TenBridge *TenBridgeTransactorSession) RemoveToken(asset common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.RemoveToken(&_TenBridge.TransactOpts, asset) +} + +// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. +// +// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() +func (_TenBridge *TenBridgeTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "renounceRole", role, callerConfirmation) +} + +// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. +// +// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() +func (_TenBridge *TenBridgeSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.RenounceRole(&_TenBridge.TransactOpts, role, callerConfirmation) +} + +// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. +// +// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() +func (_TenBridge *TenBridgeTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.RenounceRole(&_TenBridge.TransactOpts, role, callerConfirmation) +} + +// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. +// +// Solidity: function revokeRole(bytes32 role, address account) returns() +func (_TenBridge *TenBridgeTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "revokeRole", role, account) +} + +// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. +// +// Solidity: function revokeRole(bytes32 role, address account) returns() +func (_TenBridge *TenBridgeSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.RevokeRole(&_TenBridge.TransactOpts, role, account) +} + +// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. +// +// Solidity: function revokeRole(bytes32 role, address account) returns() +func (_TenBridge *TenBridgeTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.RevokeRole(&_TenBridge.TransactOpts, role, account) +} + +// SendERC20 is a paid mutator transaction binding the contract method 0xa381c8e2. +// +// Solidity: function sendERC20(address asset, uint256 amount, address receiver) payable returns() +func (_TenBridge *TenBridgeTransactor) SendERC20(opts *bind.TransactOpts, asset common.Address, amount *big.Int, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "sendERC20", asset, amount, receiver) +} + +// SendERC20 is a paid mutator transaction binding the contract method 0xa381c8e2. +// +// Solidity: function sendERC20(address asset, uint256 amount, address receiver) payable returns() +func (_TenBridge *TenBridgeSession) SendERC20(asset common.Address, amount *big.Int, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.SendERC20(&_TenBridge.TransactOpts, asset, amount, receiver) +} + +// SendERC20 is a paid mutator transaction binding the contract method 0xa381c8e2. +// +// Solidity: function sendERC20(address asset, uint256 amount, address receiver) payable returns() +func (_TenBridge *TenBridgeTransactorSession) SendERC20(asset common.Address, amount *big.Int, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.SendERC20(&_TenBridge.TransactOpts, asset, amount, receiver) +} + +// SendNative is a paid mutator transaction binding the contract method 0x1888d712. +// +// Solidity: function sendNative(address receiver) payable returns() +func (_TenBridge *TenBridgeTransactor) SendNative(opts *bind.TransactOpts, receiver common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "sendNative", receiver) +} + +// SendNative is a paid mutator transaction binding the contract method 0x1888d712. +// +// Solidity: function sendNative(address receiver) payable returns() +func (_TenBridge *TenBridgeSession) SendNative(receiver common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.SendNative(&_TenBridge.TransactOpts, receiver) +} + +// SendNative is a paid mutator transaction binding the contract method 0x1888d712. +// +// Solidity: function sendNative(address receiver) payable returns() +func (_TenBridge *TenBridgeTransactorSession) SendNative(receiver common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.SendNative(&_TenBridge.TransactOpts, receiver) +} + +// SetRemoteBridge is a paid mutator transaction binding the contract method 0x16ce8149. +// +// Solidity: function setRemoteBridge(address bridge) returns() +func (_TenBridge *TenBridgeTransactor) SetRemoteBridge(opts *bind.TransactOpts, bridge common.Address) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "setRemoteBridge", bridge) +} + +// SetRemoteBridge is a paid mutator transaction binding the contract method 0x16ce8149. +// +// Solidity: function setRemoteBridge(address bridge) returns() +func (_TenBridge *TenBridgeSession) SetRemoteBridge(bridge common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.SetRemoteBridge(&_TenBridge.TransactOpts, bridge) +} + +// SetRemoteBridge is a paid mutator transaction binding the contract method 0x16ce8149. +// +// Solidity: function setRemoteBridge(address bridge) returns() +func (_TenBridge *TenBridgeTransactorSession) SetRemoteBridge(bridge common.Address) (*types.Transaction, error) { + return _TenBridge.Contract.SetRemoteBridge(&_TenBridge.TransactOpts, bridge) +} + +// WhitelistToken is a paid mutator transaction binding the contract method 0x498d82ab. +// +// Solidity: function whitelistToken(address asset, string name, string symbol) returns() +func (_TenBridge *TenBridgeTransactor) WhitelistToken(opts *bind.TransactOpts, asset common.Address, name string, symbol string) (*types.Transaction, error) { + return _TenBridge.contract.Transact(opts, "whitelistToken", asset, name, symbol) +} + +// WhitelistToken is a paid mutator transaction binding the contract method 0x498d82ab. +// +// Solidity: function whitelistToken(address asset, string name, string symbol) returns() +func (_TenBridge *TenBridgeSession) WhitelistToken(asset common.Address, name string, symbol string) (*types.Transaction, error) { + return _TenBridge.Contract.WhitelistToken(&_TenBridge.TransactOpts, asset, name, symbol) +} + +// WhitelistToken is a paid mutator transaction binding the contract method 0x498d82ab. +// +// Solidity: function whitelistToken(address asset, string name, string symbol) returns() +func (_TenBridge *TenBridgeTransactorSession) WhitelistToken(asset common.Address, name string, symbol string) (*types.Transaction, error) { + return _TenBridge.Contract.WhitelistToken(&_TenBridge.TransactOpts, asset, name, symbol) +} + +// TenBridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TenBridge contract. +type TenBridgeInitializedIterator struct { + Event *TenBridgeInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TenBridgeInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TenBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TenBridgeInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TenBridgeInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TenBridgeInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TenBridgeInitialized represents a Initialized event raised by the TenBridge contract. +type TenBridgeInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_TenBridge *TenBridgeFilterer) FilterInitialized(opts *bind.FilterOpts) (*TenBridgeInitializedIterator, error) { + + logs, sub, err := _TenBridge.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &TenBridgeInitializedIterator{contract: _TenBridge.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_TenBridge *TenBridgeFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TenBridgeInitialized) (event.Subscription, error) { + + logs, sub, err := _TenBridge.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TenBridgeInitialized) + if err := _TenBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_TenBridge *TenBridgeFilterer) ParseInitialized(log types.Log) (*TenBridgeInitialized, error) { + event := new(TenBridgeInitialized) + if err := _TenBridge.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TenBridgeRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the TenBridge contract. +type TenBridgeRoleAdminChangedIterator struct { + Event *TenBridgeRoleAdminChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TenBridgeRoleAdminChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TenBridgeRoleAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TenBridgeRoleAdminChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TenBridgeRoleAdminChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TenBridgeRoleAdminChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TenBridgeRoleAdminChanged represents a RoleAdminChanged event raised by the TenBridge contract. +type TenBridgeRoleAdminChanged struct { + Role [32]byte + PreviousAdminRole [32]byte + NewAdminRole [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. +// +// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) +func (_TenBridge *TenBridgeFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*TenBridgeRoleAdminChangedIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var previousAdminRoleRule []interface{} + for _, previousAdminRoleItem := range previousAdminRole { + previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) + } + var newAdminRoleRule []interface{} + for _, newAdminRoleItem := range newAdminRole { + newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) + } + + logs, sub, err := _TenBridge.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) + if err != nil { + return nil, err + } + return &TenBridgeRoleAdminChangedIterator{contract: _TenBridge.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil +} + +// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. +// +// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) +func (_TenBridge *TenBridgeFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *TenBridgeRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var previousAdminRoleRule []interface{} + for _, previousAdminRoleItem := range previousAdminRole { + previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) + } + var newAdminRoleRule []interface{} + for _, newAdminRoleItem := range newAdminRole { + newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) + } + + logs, sub, err := _TenBridge.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TenBridgeRoleAdminChanged) + if err := _TenBridge.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. +// +// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) +func (_TenBridge *TenBridgeFilterer) ParseRoleAdminChanged(log types.Log) (*TenBridgeRoleAdminChanged, error) { + event := new(TenBridgeRoleAdminChanged) + if err := _TenBridge.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TenBridgeRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the TenBridge contract. +type TenBridgeRoleGrantedIterator struct { + Event *TenBridgeRoleGranted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TenBridgeRoleGrantedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TenBridgeRoleGranted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TenBridgeRoleGranted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TenBridgeRoleGrantedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TenBridgeRoleGrantedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TenBridgeRoleGranted represents a RoleGranted event raised by the TenBridge contract. +type TenBridgeRoleGranted struct { + Role [32]byte + Account common.Address + Sender common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. +// +// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +func (_TenBridge *TenBridgeFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*TenBridgeRoleGrantedIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TenBridge.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return &TenBridgeRoleGrantedIterator{contract: _TenBridge.contract, event: "RoleGranted", logs: logs, sub: sub}, nil +} + +// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. +// +// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +func (_TenBridge *TenBridgeFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *TenBridgeRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TenBridge.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TenBridgeRoleGranted) + if err := _TenBridge.contract.UnpackLog(event, "RoleGranted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. +// +// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +func (_TenBridge *TenBridgeFilterer) ParseRoleGranted(log types.Log) (*TenBridgeRoleGranted, error) { + event := new(TenBridgeRoleGranted) + if err := _TenBridge.contract.UnpackLog(event, "RoleGranted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TenBridgeRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the TenBridge contract. +type TenBridgeRoleRevokedIterator struct { + Event *TenBridgeRoleRevoked // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TenBridgeRoleRevokedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TenBridgeRoleRevoked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TenBridgeRoleRevoked) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TenBridgeRoleRevokedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TenBridgeRoleRevokedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TenBridgeRoleRevoked represents a RoleRevoked event raised by the TenBridge contract. +type TenBridgeRoleRevoked struct { + Role [32]byte + Account common.Address + Sender common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. +// +// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) +func (_TenBridge *TenBridgeFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*TenBridgeRoleRevokedIterator, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TenBridge.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return &TenBridgeRoleRevokedIterator{contract: _TenBridge.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil +} + +// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. +// +// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) +func (_TenBridge *TenBridgeFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *TenBridgeRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { + + var roleRule []interface{} + for _, roleItem := range role { + roleRule = append(roleRule, roleItem) + } + var accountRule []interface{} + for _, accountItem := range account { + accountRule = append(accountRule, accountItem) + } + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + + logs, sub, err := _TenBridge.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TenBridgeRoleRevoked) + if err := _TenBridge.contract.UnpackLog(event, "RoleRevoked", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. +// +// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) +func (_TenBridge *TenBridgeFilterer) ParseRoleRevoked(log types.Log) (*TenBridgeRoleRevoked, error) { + event := new(TenBridgeRoleRevoked) + if err := _TenBridge.contract.UnpackLog(event, "RoleRevoked", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/src/bridge/L1/IObscuroBridgeAdmin.sol b/contracts/src/bridge/L1/ITenBridgeAdmin.sol similarity index 95% rename from contracts/src/bridge/L1/IObscuroBridgeAdmin.sol rename to contracts/src/bridge/L1/ITenBridgeAdmin.sol index b35efbc0a9..57e4f47ea7 100644 --- a/contracts/src/bridge/L1/IObscuroBridgeAdmin.sol +++ b/contracts/src/bridge/L1/ITenBridgeAdmin.sol @@ -4,7 +4,7 @@ pragma solidity >=0.7.0 <0.9.0; // The interface for the layer 1 bridge that drives the whitelist // and has the functionality to modify it. -interface IObscuroBridgeAdmin { +interface ITenBridgeAdmin { // This will whitelist a token and generate a cross chain message to the ITokenFactory // to create wrapped tokens in case of success. function whitelistToken( diff --git a/contracts/src/bridge/L1/ObscuroBridge.sol b/contracts/src/bridge/L1/TenBridge.sol similarity index 94% rename from contracts/src/bridge/L1/ObscuroBridge.sol rename to contracts/src/bridge/L1/TenBridge.sol index 67e6fc0725..3599a3901c 100644 --- a/contracts/src/bridge/L1/ObscuroBridge.sol +++ b/contracts/src/bridge/L1/TenBridge.sol @@ -2,7 +2,7 @@ pragma solidity >=0.7.0 <0.9.0; -import "./IObscuroBridgeAdmin.sol"; +import "./ITenBridgeAdmin.sol"; import "../IBridge.sol"; import "../ITokenFactory.sol"; import "../../messaging/messenger/CrossChainEnabledObscuro.sol"; @@ -12,10 +12,10 @@ import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; // This is the Ethereum side of the Obscuro Bridge. // End-users can interact with it to transfer ERC20 tokens and native eth to the Layer 2 Obscuro. -contract ObscuroBridge is +contract TenBridge is CrossChainEnabledObscuro, IBridge, - IObscuroBridgeAdmin, + ITenBridgeAdmin, AccessControl { // This is the role that is given to the address that represents a native currency @@ -59,7 +59,7 @@ contract ObscuroBridge is data, uint32(Topics.MANAGEMENT), 0, - 0, + 0, 0 ); } @@ -79,6 +79,8 @@ contract ObscuroBridge is // verify ETH deposit. function sendNative(address receiver) external payable override { require(msg.value > 0, "Empty transfer."); + bytes memory data = abi.encode(ValueTransfer(msg.value, receiver)); + queueMessage(remoteBridgeAddress, data, uint32(Topics.VALUE), 0, 0, 0); _messageBus().sendValueToL2{value: msg.value}(receiver, msg.value); } diff --git a/contracts/test/bridge-test.ts b/contracts/test/bridge-test.ts index d578b173d7..9b197a296c 100644 --- a/contracts/test/bridge-test.ts +++ b/contracts/test/bridge-test.ts @@ -2,7 +2,7 @@ import { expect } from "chai"; import hre, { ethers } from "hardhat"; import { time } from "@nomicfoundation/hardhat-network-helpers"; import { bridge } from "../typechain-types/src"; -import { MessageBus, ObscuroBridge, WrappedERC20__factory } from "../typechain-types"; +import { MessageBus, TenBridge, WrappedERC20__factory } from "../typechain-types"; import { EthereumBridge } from "../typechain-types/src/bridge/L2/EthereumBridge"; import { CrossChainMessenger } from "../typechain-types/src/messaging/messenger"; import { Contract } from "hardhat/internal/hardhat-network/stack-traces/model"; @@ -22,7 +22,7 @@ describe("Bridge", function () { let messengerL1: CrossChainMessenger let messengerL2: CrossChainMessenger - let bridgeL1 : ObscuroBridge + let bridgeL1 : TenBridge let bridgeL2 : EthereumBridge let erc20address : any @@ -30,7 +30,7 @@ describe("Bridge", function () { this.beforeEach(async function(){ const MessageBus = await hre.ethers.getContractFactory("MessageBus"); const Messenger = await hre.ethers.getContractFactory("CrossChainMessenger"); - const L1Bridge = await hre.ethers.getContractFactory("ObscuroBridge"); + const L1Bridge = await hre.ethers.getContractFactory("TenBridge"); const L2Bridge = await hre.ethers.getContractFactory("EthereumBridge"); const [owner] = await ethers.getSigners();