diff --git a/.github/workflows/manual-deploy-dexynth-gateway.yml b/.github/workflows/manual-deploy-dexynth-gateway.yml new file mode 100644 index 0000000000..201999b3e0 --- /dev/null +++ b/.github/workflows/manual-deploy-dexynth-gateway.yml @@ -0,0 +1,139 @@ +# Deploys Ten Gateway for Dexynth on Azure for Testnet +# Builds the Ten Gateway image, pushes the image to dockerhub and starts the Obscuro Gateway on Azure VM + +name: '[M] Deploy Ten Gateway Dexynth' +run-name: '[M] Deploy Ten Gateway Dexynth ( ${{ github.event.inputs.testnet_type }} )' +on: + workflow_dispatch: + inputs: + testnet_type: + description: 'Testnet Type' + required: true + default: 'sepolia-testnet' + type: choice + options: + - 'sepolia-testnet' + +jobs: + build-and-deploy-dexynth: + runs-on: ubuntu-latest + environment: + name: {{ github.event.inputs.testnet_type }} + steps: + - name: 'Print GitHub variables' + # This is a useful record of what the environment variables were at the time the job ran, for debugging and reference + run: | + echo "GitHub Variables = ${{ toJSON(vars) }}" + + - uses: actions/checkout@v3 + + - name: 'Extract branch name' + shell: bash + run: | + echo "Branch Name: ${GITHUB_REF_NAME}" + echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV + + - name: 'Set up Docker' + uses: docker/setup-buildx-action@v1 + + - name: 'Login to Azure docker registry' + uses: azure/docker-login@v1 + with: + login-server: testnetobscuronet.azurecr.io + username: testnetobscuronet + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: 'Login via Azure CLI' + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Build and Push Docker Image + run: | + DOCKER_BUILDKIT=1 docker build --build-arg TESTNET_TYPE=${{ github.event.inputs.testnet_type }} -t ${{ vars.DOCKER_BUILD_TAG_GATEWAY_DEXYNTH }} -f ./tools/walletextension/Dockerfile . + docker push ${{ vars.DOCKER_BUILD_TAG_GATEWAY_DEXYNTH }} + + # This will fail some deletions due to resource dependencies ( ie. you must first delete the vm before deleting the disk) + - name: 'Delete deployed VMs' + uses: azure/CLI@v1 + with: + inlineScript: | + $(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_GATEWAY_DEXYNTH }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + + # This will clean up any lingering dependencies - might fail if there are no resources to cleanup + - name: 'Delete VMs dependencies' + uses: azure/CLI@v1 + with: + inlineScript: | + $(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_GATEWAY_DEXYNTH }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + + - name: 'Ensure VM Static Public IP Exists' + uses: azure/CLI@v1 + with: + inlineScript: | + az network public-ip show -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-static-dexynth" || az network public-ip create -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-static-dexynth" --allocation-method Static --sku Standard + + - name: 'Assign/Update DNS Name for Public IP' + uses: azure/CLI@v1 + with: + inlineScript: | + existing_dns_name=$(az network public-ip show -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-static-dexynth" --query dnsSettings.domainNameLabel -o tsv) + if [ -z "$existing_dns_name" ]; then + az network public-ip update -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-static-dexynth" --dns-name "obscurogateway-${{ github.event.inputs.testnet_type }}-dexynth" + fi + + - name: 'Create VM for Gateway node on Azure' + uses: azure/CLI@v1 + with: + inlineScript: | + az vm create -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }}-dexynth" \ + --admin-username obscurouser --admin-password "${{ secrets.OBSCURO_NODE_VM_PWD }}" \ + --public-ip-address "${{ github.event.inputs.testnet_type }}-OG-static-dexynth" \ + --tags deploygroup=ObscuroGateway-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}-dexynth ${{ vars.AZURE_DEPLOY_GROUP_GATEWAY_DEXYNTH }}=true \ + --vnet-name ObscuroGateway-${{ github.event.inputs.testnet_type }}-dexynth-01VNET --subnet ObscuroGateway-${{ github.event.inputs.testnet_type }}-dexynth-01Subnet \ + --size Standard_D4_v5 --image Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest \ + --authentication-type password + + - name: 'Open Obscuro node-${{ matrix.host_id }} ports on Azure' + uses: azure/CLI@v1 + with: + inlineScript: | + az vm open-port -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }}-dexynth" --port 80,81 + + # To overcome issues with critical VM resources being unavailable, we need to wait for the VM to be ready + - name: 'Allow time for VM initialization' + shell: bash + run: sleep 30 + + - name: 'Start Obscuro gateway on Azure' + uses: azure/CLI@v1 + with: + inlineScript: | + az vm run-command invoke -g Testnet -n "${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }}-dexynth" \ + --command-id RunShellScript \ + --scripts 'mkdir -p /home/obscuro \ + && sudo apt-get update \ + && sudo apt-get install -y gcc \ + && sudo snap refresh && sudo snap install --channel=1.18 go --classic \ + && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ + && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ + && docker network create --driver bridge node_network || true \ + && docker run -d --name datadog-agent \ + --network node_network \ + -e DD_API_KEY=${{ secrets.DD_API_KEY }} \ + -e DD_LOGS_ENABLED=true \ + -e DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true \ + -e DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION=true \ + -e DD_CONTAINER_EXCLUDE_LOGS="name:datadog-agent" \ + -e DD_SITE="datadoghq.eu" \ + -v /var/run/docker.sock:/var/run/docker.sock:ro \ + -v /proc/:/host/proc/:ro \ + -v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \ + -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \ + datadog/agent:latest \ + && cd /home/obscuro/go-obscuro/ \ + && docker run -d -p 80:80 -p 81:81 --name ${{ github.event.inputs.testnet_type }}-OG-${{ GITHUB.RUN_NUMBER }}-dexynth \ + -e OBSCURO_GATEWAY_VERSION="${{ GITHUB.RUN_NUMBER }}-${{ GITHUB.SHA }}" \ + ${{ vars.DOCKER_BUILD_TAG_GATEWAY_DEXYNTH }} \ + -host=0.0.0.0 -port=8080 -portWS=81 -nodeHost=${{ vars.L2_RPC_URL_VALIDATOR_DEXYNTH }} -verbose=true \ + -logPath=sys_out -dbType=mariaDB -dbConnectionURL="obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb"' diff --git a/contracts/generated/EthereumBridge/EthereumBridge.go b/contracts/generated/EthereumBridge/EthereumBridge.go index a88793f106..70044a1ed4 100644 --- a/contracts/generated/EthereumBridge/EthereumBridge.go +++ b/contracts/generated/EthereumBridge/EthereumBridge.go @@ -32,7 +32,7 @@ var ( // EthereumBridgeMetaData contains all meta data concerning the EthereumBridge contract. var EthereumBridgeMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"remoteAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"localAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"CreatedWrappedToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"messengerAddress\",\"type\":\"address\"}],\"name\":\"configure\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wrappedToken\",\"type\":\"address\"}],\"name\":\"hasTokenMapping\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"messenger\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"remoteBridge\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"localToRemoteToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"crossChainAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol\",\"type\":\"string\"}],\"name\":\"onCreateTokenCommand\",\"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\":\"\",\"type\":\"address\"}],\"name\":\"remoteToLocalToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"sendNative\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"wrappedTokens\",\"outputs\":[{\"internalType\":\"contractWrappedERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x60806040526001805463ffffffff60a01b1916905534801561002057600080fd5b50612681806100306000396000f3fe608060405260043610620000c65760003560e01c806383bece4d11620000735780639e405b7111620000555780639e405b7114620002dc578063a381c8e21462000316578063d5c6b504146200033b576200013f565b806383bece4d14620002675780639813c7b2146200028c576200013f565b8063458ffd6311620000a9578063458ffd6314620001f8578063485cc955146200021d57806375cb26721462000242576200013f565b80628d48e314620001885780631888d71214620001df576200013f565b366200013f5760405162461bcd60e51b815260206004820152602360248201527f436f6e747261637420646f6573206e6f7420737570706f72742072656365697660448201527f652829000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152601d60248201527f66616c6c6261636b2829206d6574686f6420756e737570706f72746564000000604482015260640162000136565b3480156200019557600080fd5b50620001c2620001a736600462000f7f565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b620001f6620001f036600462000f7f565b62000375565b005b3480156200020557600080fd5b50620001f66200021736600462000ff2565b62000526565b3480156200022a57600080fd5b50620001f66200023c3660046200107e565b62000739565b3480156200024f57600080fd5b50620001f66200026136600462000f7f565b620008a7565b3480156200027457600080fd5b50620001f662000286366004620010bc565b62000987565b3480156200029957600080fd5b50620002cb620002ab36600462000f7f565b6001600160a01b0390811660009081526002602052604090205416151590565b6040519015158152602001620001d6565b348015620002e957600080fd5b50620001c2620002fb36600462000f7f565b6003602052600090815260409020546001600160a01b031681565b3480156200032357600080fd5b50620001f662000335366004620010bc565b62000bca565b3480156200034857600080fd5b50620001c26200035a36600462000f7f565b6002602052600090815260409020546001600160a01b031681565b60003411620003c75760405162461bcd60e51b815260206004820152600d60248201527f4e6f7468696e672073656e742e00000000000000000000000000000000000000604482015260640162000136565b6000805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b546001600160a01b0316620004495760405162461bcd60e51b815260206004820152601560248201527f4e6f206d617070696e6720666f7220746f6b656e2e0000000000000000000000604482015260640162000136565b600080805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff546040516001600160a01b03918216602482015234604482015290831660648201526383bece4d60e01b9060840160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915260055490915062000522906001600160a01b03168260005b60008062000d59565b5050565b6005546000546001600160a01b0391821691163314620005af5760405162461bcd60e51b815260206004820152603060248201527f436f6e74726163742063616c6c6572206973206e6f742074686520726567697360448201527f7465726564206d657373656e6765722100000000000000000000000000000000606482015260840162000136565b806001600160a01b0316620005c362000e6e565b6001600160a01b031614620006415760405162461bcd60e51b815260206004820152603160248201527f43726f737320636861696e206d65737361676520636f6d696e672066726f6d2060448201527f696e636f72726563742073656e64657221000000000000000000000000000000606482015260840162000136565b600085858585604051620006559062000f58565b6200066494939291906200112c565b604051809103906000f08015801562000681573d6000803e3d6000fd5b506001600160a01b038082166000818152600260209081526040808320805473ffffffffffffffffffffffffffffffffffffffff199081168617909155600383528184208054968f169682168717905594835260049091529081902080549093169091179091555190915081907f30c05779f384e0ae9d43bbf7ec4417f28bdc53d02a35551b6eb270a9c4c71dca9062000727908a9084908b908b908b908b9062001162565b60405180910390a15050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff16600081158015620007855750825b905060008267ffffffffffffffff166001148015620007a35750303b155b905081158015620007b2575080155b15620007ea576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156200081f57845468ff00000000000000001916680100000000000000001785555b6200082a87620008a7565b6005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03881617905583156200089e57845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b620008b162000eee565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155604080517fa1a227fa000000000000000000000000000000000000000000000000000000008152905163a1a227fa916004808201926020929091908290030181865afa15801562000931573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009579190620011b3565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905550565b6005546000546001600160a01b039182169116331462000a105760405162461bcd60e51b815260206004820152603060248201527f436f6e74726163742063616c6c6572206973206e6f742074686520726567697360448201527f7465726564206d657373656e6765722100000000000000000000000000000000606482015260840162000136565b806001600160a01b031662000a2462000e6e565b6001600160a01b03161462000aa25760405162461bcd60e51b815260206004820152603160248201527f43726f737320636861696e206d65737361676520636f6d696e672066726f6d2060448201527f696e636f72726563742073656e64657221000000000000000000000000000000606482015260840162000136565b6001600160a01b0380851660009081526004602090815260408083205484168084526002909252909120549091168062000b455760405162461bcd60e51b815260206004820152602b60248201527f526563656976696e672061737365747320666f7220756e6b6e6f776e2077726160448201527f7070656420746f6b656e21000000000000000000000000000000000000000000606482015260840162000136565b6040517f979005ad0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301526024820187905282169063979005ad90604401600060405180830381600087803b15801562000ba957600080fd5b505af115801562000bbe573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b038084166000908152600260205260409020541662000c335760405162461bcd60e51b815260206004820152601560248201527f4e6f206d617070696e6720666f7220746f6b656e2e0000000000000000000000604482015260640162000136565b6001600160a01b03838116600090815260026020526040908190205490517f1dd319cb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529116908190631dd319cb90604401600060405180830381600087803b15801562000caa57600080fd5b505af115801562000cbf573d6000803e3d6000fd5b505050506001600160a01b03848116600090815260036020908152604080832054815190851660248201526044810188905286851660648083019190915282518083039091018152608490910190915290810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166383bece4d60e01b179052600554909262000d5292911690839062000519565b5050505050565b60006040518060600160405280876001600160a01b031681526020018681526020018481525060405160200162000d9191906200121b565b60408051808303601f19018152919052600180549192506001600160a01b0382169163b1454caa917401000000000000000000000000000000000000000090910463ffffffff1690601462000de68362001262565b91906101000a81548163ffffffff021916908363ffffffff1602179055508684866040518563ffffffff1660e01b815260040162000e289493929190620012ad565b6020604051808303816000875af115801562000e48573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200089e9190620012ec565b60008060009054906101000a90046001600160a01b03166001600160a01b03166363012de56040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ec3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ee99190620011b3565b905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1662000f56576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611333806200131983390190565b6001600160a01b038116811462000f7c57600080fd5b50565b60006020828403121562000f9257600080fd5b813562000f9f8162000f66565b9392505050565b60008083601f84011262000fb957600080fd5b50813567ffffffffffffffff81111562000fd257600080fd5b60208301915083602082850101111562000feb57600080fd5b9250929050565b6000806000806000606086880312156200100b57600080fd5b8535620010188162000f66565b9450602086013567ffffffffffffffff808211156200103657600080fd5b6200104489838a0162000fa6565b909650945060408801359150808211156200105e57600080fd5b506200106d8882890162000fa6565b969995985093965092949392505050565b600080604083850312156200109257600080fd5b82356200109f8162000f66565b91506020830135620010b18162000f66565b809150509250929050565b600080600060608486031215620010d257600080fd5b8335620010df8162000f66565b9250602084013591506040840135620010f88162000f66565b809150509250925092565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6040815260006200114260408301868862001103565b82810360208401526200115781858762001103565b979650505050505050565b60006001600160a01b038089168352808816602084015250608060408301526200119160808301868862001103565b8281036060840152620011a681858762001103565b9998505050505050505050565b600060208284031215620011c657600080fd5b815162000f9f8162000f66565b6000815180845260005b81811015620011fb57602081850181015186830182015201620011dd565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160a01b03825116602082015260006020830151606060408401526200124c6080840182620011d3565b9050604084015160608401528091505092915050565b600063ffffffff808316818103620012a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001019392505050565b600063ffffffff808716835280861660208401525060806040830152620012d86080830185620011d3565b905060ff8316606083015295945050505050565b600060208284031215620012ff57600080fd5b815167ffffffffffffffff8116811462000f9f57600080fdfe6080604052600580546001600160a01b03191673deb34a740eca1ec42c8b8204cbec0ba34fdd27f31790553480156200003757600080fd5b5060405162001333380380620013338339810160408190526200005a9162000233565b8181818160036200006c83826200032c565b5060046200007b82826200032c565b5050505050620000b27fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620000bb60201b60201c565b505050620003f8565b60008281526007602090815260408083206001600160a01b038516845290915281205460ff16620001645760008381526007602090815260408083206001600160a01b03861684529091529020805460ff191660011790556200011b3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000168565b5060005b92915050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200019657600080fd5b81516001600160401b0380821115620001b357620001b36200016e565b604051601f8301601f19908116603f01168101908282118183101715620001de57620001de6200016e565b81604052838152602092508683858801011115620001fb57600080fd5b600091505b838210156200021f578582018301518183018401529082019062000200565b600093810190920192909252949350505050565b600080604083850312156200024757600080fd5b82516001600160401b03808211156200025f57600080fd5b6200026d8683870162000184565b935060208501519150808211156200028457600080fd5b50620002938582860162000184565b9150509250929050565b600181811c90821680620002b257607f821691505b602082108103620002d357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200032757600081815260208120601f850160051c81016020861015620003025750805b601f850160051c820191505b8181101562000323578281556001016200030e565b5050505b505050565b81516001600160401b038111156200034857620003486200016e565b62000360816200035984546200029d565b84620002d9565b602080601f8311600181146200039857600084156200037f5750858301515b600019600386901b1c1916600185901b17855562000323565b600085815260208120601f198616915b82811015620003c957888601518255948401946001909101908401620003a8565b5085821015620003e85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610f2b80620004086000396000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806336568abe116100cd578063979005ad11610081578063a9059cbb11610066578063a9059cbb146102ce578063d547741f146102e1578063dd62ed3e146102f457600080fd5b8063979005ad146102b3578063a217fddf146102c657600080fd5b806375b238fc116100b257806375b238fc1461024b57806391d148541461027257806395d89b41146102ab57600080fd5b806336568abe1461022557806370a082311461023857600080fd5b80631dd319cb11610124578063248a9ca311610109578063248a9ca3146101e05780632f2ff15d14610203578063313ce5671461021657600080fd5b80631dd319cb146101b857806323b872dd146101cd57600080fd5b806301ffc9a71461015657806306fdde031461017e578063095ea7b31461019357806318160ddd146101a6575b600080fd5b610169610164366004610cf7565b610307565b60405190151581526020015b60405180910390f35b6101866103a0565b6040516101759190610d40565b6101696101a1366004610daa565b610432565b6002545b604051908152602001610175565b6101cb6101c6366004610daa565b61044a565b005b6101696101db366004610dd4565b6104e0565b6101aa6101ee366004610e10565b60009081526007602052604090206001015490565b6101cb610211366004610e29565b610504565b60405160128152602001610175565b6101cb610233366004610e29565b61052f565b6101aa610246366004610e55565b61057b565b6101aa7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b610169610280366004610e29565b60009182526007602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610186610621565b6101cb6102c1366004610daa565b610630565b6101aa600081565b6101696102dc366004610daa565b610664565b6101cb6102ef366004610e29565b610672565b6101aa610302366004610e70565b610697565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061039a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6060600380546103af90610e9a565b80601f01602080910402602001604051908101604052809291908181526020018280546103db90610e9a565b80156104285780601f106103fd57610100808354040283529160200191610428565b820191906000526020600020905b81548152906001019060200180831161040b57829003601f168201915b5050505050905090565b6000336104408185856107a8565b5060019392505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610474816107b5565b8161047e8461057b565b10156104d15760405162461bcd60e51b815260206004820152601560248201527f496e73756666696369656e742062616c616e63652e000000000000000000000060448201526064015b60405180910390fd5b6104db83836107c2565b505050565b6000336104ee8582856107fc565b6104f9858585610875565b506001949350505050565b60008281526007602052604090206001015461051f816107b5565b61052983836108d4565b50505050565b6001600160a01b0381163314610571576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104db8282610982565b60006001600160a01b03821632036105ab576001600160a01b03821660009081526020819052604090205461039a565b6001600160a01b03821633036105d9576001600160a01b03821660009081526020819052604090205461039a565b60405162461bcd60e51b815260206004820152601f60248201527f4e6f7420616c6c6f77656420746f2072656164207468652062616c616e63650060448201526064016104c8565b6060600480546103af90610e9a565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561065a816107b5565b6104db8383610a09565b600033610440818585610875565b60008281526007602052604090206001015461068d816107b5565b6105298383610982565b6000326001600160a01b03841614806106b85750326001600160a01b038316145b156106eb576001600160a01b038084166000908152600160209081526040808320938616835292905220545b905061039a565b336001600160a01b038416148061070a5750336001600160a01b038316145b1561073a576001600160a01b038084166000908152600160209081526040808320938616835292905220546106e4565b60405162461bcd60e51b815260206004820152602160248201527f4e6f7420616c6c6f77656420746f20726561642074686520616c6c6f77616e6360448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016104c8565b6104db8383836001610a3f565b6107bf8133610b46565b50565b6001600160a01b0382166107ec57604051634b637e8f60e11b8152600060048201526024016104c8565b6107f882600083610bb4565b5050565b60006108088484610697565b905060001981146105295781811015610866576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101829052604481018390526064016104c8565b61052984848484036000610a3f565b6001600160a01b03831661089f57604051634b637e8f60e11b8152600060048201526024016104c8565b6001600160a01b0382166108c95760405163ec442f0560e01b8152600060048201526024016104c8565b6104db838383610bb4565b60008281526007602090815260408083206001600160a01b038516845290915281205460ff1661097a5760008381526007602090815260408083206001600160a01b03861684529091529020805460ff191660011790556109323390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161039a565b50600061039a565b60008281526007602090815260408083206001600160a01b038516845290915281205460ff161561097a5760008381526007602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161039a565b6001600160a01b038216610a335760405163ec442f0560e01b8152600060048201526024016104c8565b6107f860008383610bb4565b6001600160a01b038416610a82576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016104c8565b6001600160a01b038316610ac5576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016104c8565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561052957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610b3891815260200190565b60405180910390a350505050565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff166107f8576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016104c8565b6001600160a01b038316610bdf578060026000828254610bd49190610ed4565b90915550610c6a9050565b6001600160a01b03831660009081526020819052604090205481811015610c4b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260248101829052604481018390526064016104c8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b038216610c8657600280548290039055610ca5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610cea91815260200190565b60405180910390a3505050565b600060208284031215610d0957600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d3957600080fd5b9392505050565b600060208083528351808285015260005b81811015610d6d57858101830151858201604001528201610d51565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610da557600080fd5b919050565b60008060408385031215610dbd57600080fd5b610dc683610d8e565b946020939093013593505050565b600080600060608486031215610de957600080fd5b610df284610d8e565b9250610e0060208501610d8e565b9150604084013590509250925092565b600060208284031215610e2257600080fd5b5035919050565b60008060408385031215610e3c57600080fd5b82359150610e4c60208401610d8e565b90509250929050565b600060208284031215610e6757600080fd5b610d3982610d8e565b60008060408385031215610e8357600080fd5b610e8c83610d8e565b9150610e4c60208401610d8e565b600181811c90821680610eae57607f821691505b602082108103610ece57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561039a57634e487b7160e01b600052601160045260246000fdfea264697066735822122039afc3e962a028dadcb3bb38163ee2ffb83c07448aa3e63bac97d5ca6c320b4b64736f6c63430008140033a2646970667358221220e240c73d81552475fa92eac167008e373bc6d66e5a1a4607003dcd422710100464736f6c63430008140033", + Bin: "0x60806040526001805463ffffffff60a01b1916905534801561002057600080fd5b50612688806100306000396000f3fe608060405260043610620000c65760003560e01c806383bece4d11620000735780639e405b7111620000555780639e405b7114620002dc578063a381c8e21462000316578063d5c6b504146200033b576200013f565b806383bece4d14620002675780639813c7b2146200028c576200013f565b8063458ffd6311620000a9578063458ffd6314620001f8578063485cc955146200021d57806375cb26721462000242576200013f565b80628d48e314620001885780631888d71214620001df576200013f565b366200013f5760405162461bcd60e51b815260206004820152602360248201527f436f6e747261637420646f6573206e6f7420737570706f72742072656365697660448201527f652829000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152601d60248201527f66616c6c6261636b2829206d6574686f6420756e737570706f72746564000000604482015260640162000136565b3480156200019557600080fd5b50620001c2620001a736600462000f86565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b620001f6620001f036600462000f86565b62000375565b005b3480156200020557600080fd5b50620001f66200021736600462000ff9565b6200052e565b3480156200022a57600080fd5b50620001f66200023c36600462001085565b62000741565b3480156200024f57600080fd5b50620001f66200026136600462000f86565b620008ae565b3480156200027457600080fd5b50620001f662000286366004620010c3565b6200098e565b3480156200029957600080fd5b50620002cb620002ab36600462000f86565b6001600160a01b0390811660009081526002602052604090205416151590565b6040519015158152602001620001d6565b348015620002e957600080fd5b50620001c2620002fb36600462000f86565b6003602052600090815260409020546001600160a01b031681565b3480156200032357600080fd5b50620001f662000335366004620010c3565b62000bd1565b3480156200034857600080fd5b50620001c26200035a36600462000f86565b6002602052600090815260409020546001600160a01b031681565b60003411620003c75760405162461bcd60e51b815260206004820152600d60248201527f4e6f7468696e672073656e742e00000000000000000000000000000000000000604482015260640162000136565b600080805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff546040516001600160a01b03918216602482015234604482015290831660648201526383bece4d60e01b9060840160408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152600554909150620004a0906001600160a01b03168260005b60008062000d60565b6001546001600160a01b03166040517f346633fb0000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152346024830181905292169163346633fb916044016000604051808303818588803b1580156200051057600080fd5b505af115801562000525573d6000803e3d6000fd5b50505050505050565b6005546000546001600160a01b0391821691163314620005b75760405162461bcd60e51b815260206004820152603060248201527f436f6e74726163742063616c6c6572206973206e6f742074686520726567697360448201527f7465726564206d657373656e6765722100000000000000000000000000000000606482015260840162000136565b806001600160a01b0316620005cb62000e75565b6001600160a01b031614620006495760405162461bcd60e51b815260206004820152603160248201527f43726f737320636861696e206d65737361676520636f6d696e672066726f6d2060448201527f696e636f72726563742073656e64657221000000000000000000000000000000606482015260840162000136565b6000858585856040516200065d9062000f5f565b6200066c949392919062001133565b604051809103906000f08015801562000689573d6000803e3d6000fd5b506001600160a01b038082166000818152600260209081526040808320805473ffffffffffffffffffffffffffffffffffffffff199081168617909155600383528184208054968f169682168717905594835260049091529081902080549093169091179091555190915081907f30c05779f384e0ae9d43bbf7ec4417f28bdc53d02a35551b6eb270a9c4c71dca906200072f908a9084908b908b908b908b9062001169565b60405180910390a15050505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156200078d5750825b905060008267ffffffffffffffff166001148015620007ab5750303b155b905081158015620007ba575080155b15620007f2576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156200082757845468ff00000000000000001916680100000000000000001785555b6200083287620008ae565b6005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03881617905583156200052557845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050565b620008b862000ef5565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155604080517fa1a227fa000000000000000000000000000000000000000000000000000000008152905163a1a227fa916004808201926020929091908290030181865afa15801562000938573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200095e9190620011ba565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905550565b6005546000546001600160a01b039182169116331462000a175760405162461bcd60e51b815260206004820152603060248201527f436f6e74726163742063616c6c6572206973206e6f742074686520726567697360448201527f7465726564206d657373656e6765722100000000000000000000000000000000606482015260840162000136565b806001600160a01b031662000a2b62000e75565b6001600160a01b03161462000aa95760405162461bcd60e51b815260206004820152603160248201527f43726f737320636861696e206d65737361676520636f6d696e672066726f6d2060448201527f696e636f72726563742073656e64657221000000000000000000000000000000606482015260840162000136565b6001600160a01b0380851660009081526004602090815260408083205484168084526002909252909120549091168062000b4c5760405162461bcd60e51b815260206004820152602b60248201527f526563656976696e672061737365747320666f7220756e6b6e6f776e2077726160448201527f7070656420746f6b656e21000000000000000000000000000000000000000000606482015260840162000136565b6040517f979005ad0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301526024820187905282169063979005ad90604401600060405180830381600087803b15801562000bb057600080fd5b505af115801562000bc5573d6000803e3d6000fd5b50505050505050505050565b6001600160a01b038084166000908152600260205260409020541662000c3a5760405162461bcd60e51b815260206004820152601560248201527f4e6f206d617070696e6720666f7220746f6b656e2e0000000000000000000000604482015260640162000136565b6001600160a01b03838116600090815260026020526040908190205490517f1dd319cb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529116908190631dd319cb90604401600060405180830381600087803b15801562000cb157600080fd5b505af115801562000cc6573d6000803e3d6000fd5b505050506001600160a01b03848116600090815260036020908152604080832054815190851660248201526044810188905286851660648083019190915282518083039091018152608490910190915290810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166383bece4d60e01b179052600554909262000d5992911690839062000497565b5050505050565b60006040518060600160405280876001600160a01b031681526020018681526020018481525060405160200162000d98919062001222565b60408051808303601f19018152919052600180549192506001600160a01b0382169163b1454caa917401000000000000000000000000000000000000000090910463ffffffff1690601462000ded8362001269565b91906101000a81548163ffffffff021916908363ffffffff1602179055508684866040518563ffffffff1660e01b815260040162000e2f9493929190620012b4565b6020604051808303816000875af115801562000e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005259190620012f3565b60008060009054906101000a90046001600160a01b03166001600160a01b03166363012de56040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000eca573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ef09190620011ba565b905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1662000f5d576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611333806200132083390190565b6001600160a01b038116811462000f8357600080fd5b50565b60006020828403121562000f9957600080fd5b813562000fa68162000f6d565b9392505050565b60008083601f84011262000fc057600080fd5b50813567ffffffffffffffff81111562000fd957600080fd5b60208301915083602082850101111562000ff257600080fd5b9250929050565b6000806000806000606086880312156200101257600080fd5b85356200101f8162000f6d565b9450602086013567ffffffffffffffff808211156200103d57600080fd5b6200104b89838a0162000fad565b909650945060408801359150808211156200106557600080fd5b50620010748882890162000fad565b969995985093965092949392505050565b600080604083850312156200109957600080fd5b8235620010a68162000f6d565b91506020830135620010b88162000f6d565b809150509250929050565b600080600060608486031215620010d957600080fd5b8335620010e68162000f6d565b9250602084013591506040840135620010ff8162000f6d565b809150509250925092565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b604081526000620011496040830186886200110a565b82810360208401526200115e8185876200110a565b979650505050505050565b60006001600160a01b03808916835280881660208401525060806040830152620011986080830186886200110a565b8281036060840152620011ad8185876200110a565b9998505050505050505050565b600060208284031215620011cd57600080fd5b815162000fa68162000f6d565b6000815180845260005b818110156200120257602081850181015186830182015201620011e4565b506000602082860101526020601f19601f83011685010191505092915050565b602081526001600160a01b0382511660208201526000602083015160606040840152620012536080840182620011da565b9050604084015160608401528091505092915050565b600063ffffffff808316818103620012aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6001019392505050565b600063ffffffff808716835280861660208401525060806040830152620012df6080830185620011da565b905060ff8316606083015295945050505050565b6000602082840312156200130657600080fd5b815167ffffffffffffffff8116811462000fa657600080fdfe6080604052600580546001600160a01b03191673deb34a740eca1ec42c8b8204cbec0ba34fdd27f31790553480156200003757600080fd5b5060405162001333380380620013338339810160408190526200005a9162000233565b8181818160036200006c83826200032c565b5060046200007b82826200032c565b5050505050620000b27fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620000bb60201b60201c565b505050620003f8565b60008281526007602090815260408083206001600160a01b038516845290915281205460ff16620001645760008381526007602090815260408083206001600160a01b03861684529091529020805460ff191660011790556200011b3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000168565b5060005b92915050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200019657600080fd5b81516001600160401b0380821115620001b357620001b36200016e565b604051601f8301601f19908116603f01168101908282118183101715620001de57620001de6200016e565b81604052838152602092508683858801011115620001fb57600080fd5b600091505b838210156200021f578582018301518183018401529082019062000200565b600093810190920192909252949350505050565b600080604083850312156200024757600080fd5b82516001600160401b03808211156200025f57600080fd5b6200026d8683870162000184565b935060208501519150808211156200028457600080fd5b50620002938582860162000184565b9150509250929050565b600181811c90821680620002b257607f821691505b602082108103620002d357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200032757600081815260208120601f850160051c81016020861015620003025750805b601f850160051c820191505b8181101562000323578281556001016200030e565b5050505b505050565b81516001600160401b038111156200034857620003486200016e565b62000360816200035984546200029d565b84620002d9565b602080601f8311600181146200039857600084156200037f5750858301515b600019600386901b1c1916600185901b17855562000323565b600085815260208120601f198616915b82811015620003c957888601518255948401946001909101908401620003a8565b5085821015620003e85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610f2b80620004086000396000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806336568abe116100cd578063979005ad11610081578063a9059cbb11610066578063a9059cbb146102ce578063d547741f146102e1578063dd62ed3e146102f457600080fd5b8063979005ad146102b3578063a217fddf146102c657600080fd5b806375b238fc116100b257806375b238fc1461024b57806391d148541461027257806395d89b41146102ab57600080fd5b806336568abe1461022557806370a082311461023857600080fd5b80631dd319cb11610124578063248a9ca311610109578063248a9ca3146101e05780632f2ff15d14610203578063313ce5671461021657600080fd5b80631dd319cb146101b857806323b872dd146101cd57600080fd5b806301ffc9a71461015657806306fdde031461017e578063095ea7b31461019357806318160ddd146101a6575b600080fd5b610169610164366004610cf7565b610307565b60405190151581526020015b60405180910390f35b6101866103a0565b6040516101759190610d40565b6101696101a1366004610daa565b610432565b6002545b604051908152602001610175565b6101cb6101c6366004610daa565b61044a565b005b6101696101db366004610dd4565b6104e0565b6101aa6101ee366004610e10565b60009081526007602052604090206001015490565b6101cb610211366004610e29565b610504565b60405160128152602001610175565b6101cb610233366004610e29565b61052f565b6101aa610246366004610e55565b61057b565b6101aa7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b610169610280366004610e29565b60009182526007602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610186610621565b6101cb6102c1366004610daa565b610630565b6101aa600081565b6101696102dc366004610daa565b610664565b6101cb6102ef366004610e29565b610672565b6101aa610302366004610e70565b610697565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061039a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6060600380546103af90610e9a565b80601f01602080910402602001604051908101604052809291908181526020018280546103db90610e9a565b80156104285780601f106103fd57610100808354040283529160200191610428565b820191906000526020600020905b81548152906001019060200180831161040b57829003601f168201915b5050505050905090565b6000336104408185856107a8565b5060019392505050565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775610474816107b5565b8161047e8461057b565b10156104d15760405162461bcd60e51b815260206004820152601560248201527f496e73756666696369656e742062616c616e63652e000000000000000000000060448201526064015b60405180910390fd5b6104db83836107c2565b505050565b6000336104ee8582856107fc565b6104f9858585610875565b506001949350505050565b60008281526007602052604090206001015461051f816107b5565b61052983836108d4565b50505050565b6001600160a01b0381163314610571576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104db8282610982565b60006001600160a01b03821632036105ab576001600160a01b03821660009081526020819052604090205461039a565b6001600160a01b03821633036105d9576001600160a01b03821660009081526020819052604090205461039a565b60405162461bcd60e51b815260206004820152601f60248201527f4e6f7420616c6c6f77656420746f2072656164207468652062616c616e63650060448201526064016104c8565b6060600480546103af90610e9a565b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177561065a816107b5565b6104db8383610a09565b600033610440818585610875565b60008281526007602052604090206001015461068d816107b5565b6105298383610982565b6000326001600160a01b03841614806106b85750326001600160a01b038316145b156106eb576001600160a01b038084166000908152600160209081526040808320938616835292905220545b905061039a565b336001600160a01b038416148061070a5750336001600160a01b038316145b1561073a576001600160a01b038084166000908152600160209081526040808320938616835292905220546106e4565b60405162461bcd60e51b815260206004820152602160248201527f4e6f7420616c6c6f77656420746f20726561642074686520616c6c6f77616e6360448201527f650000000000000000000000000000000000000000000000000000000000000060648201526084016104c8565b6104db8383836001610a3f565b6107bf8133610b46565b50565b6001600160a01b0382166107ec57604051634b637e8f60e11b8152600060048201526024016104c8565b6107f882600083610bb4565b5050565b60006108088484610697565b905060001981146105295781811015610866576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b038416600482015260248101829052604481018390526064016104c8565b61052984848484036000610a3f565b6001600160a01b03831661089f57604051634b637e8f60e11b8152600060048201526024016104c8565b6001600160a01b0382166108c95760405163ec442f0560e01b8152600060048201526024016104c8565b6104db838383610bb4565b60008281526007602090815260408083206001600160a01b038516845290915281205460ff1661097a5760008381526007602090815260408083206001600160a01b03861684529091529020805460ff191660011790556109323390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161039a565b50600061039a565b60008281526007602090815260408083206001600160a01b038516845290915281205460ff161561097a5760008381526007602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161039a565b6001600160a01b038216610a335760405163ec442f0560e01b8152600060048201526024016104c8565b6107f860008383610bb4565b6001600160a01b038416610a82576040517fe602df05000000000000000000000000000000000000000000000000000000008152600060048201526024016104c8565b6001600160a01b038316610ac5576040517f94280d62000000000000000000000000000000000000000000000000000000008152600060048201526024016104c8565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561052957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610b3891815260200190565b60405180910390a350505050565b60008281526007602090815260408083206001600160a01b038516845290915290205460ff166107f8576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016104c8565b6001600160a01b038316610bdf578060026000828254610bd49190610ed4565b90915550610c6a9050565b6001600160a01b03831660009081526020819052604090205481811015610c4b576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b038516600482015260248101829052604481018390526064016104c8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b038216610c8657600280548290039055610ca5565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610cea91815260200190565b60405180910390a3505050565b600060208284031215610d0957600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610d3957600080fd5b9392505050565b600060208083528351808285015260005b81811015610d6d57858101830151858201604001528201610d51565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610da557600080fd5b919050565b60008060408385031215610dbd57600080fd5b610dc683610d8e565b946020939093013593505050565b600080600060608486031215610de957600080fd5b610df284610d8e565b9250610e0060208501610d8e565b9150604084013590509250925092565b600060208284031215610e2257600080fd5b5035919050565b60008060408385031215610e3c57600080fd5b82359150610e4c60208401610d8e565b90509250929050565b600060208284031215610e6757600080fd5b610d3982610d8e565b60008060408385031215610e8357600080fd5b610e8c83610d8e565b9150610e4c60208401610d8e565b600181811c90821680610eae57607f821691505b602082108103610ece57634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561039a57634e487b7160e01b600052601160045260246000fdfea264697066735822122039afc3e962a028dadcb3bb38163ee2ffb83c07448aa3e63bac97d5ca6c320b4b64736f6c63430008140033a2646970667358221220f4c2ed0e823645008f51e47bef1f9753319b4dede802082b7a8d61f34615952264736f6c63430008140033", } // EthereumBridgeABI is the input ABI used to generate the binding from. diff --git a/contracts/generated/ManagementContract/ManagementContract.go b/contracts/generated/ManagementContract/ManagementContract.go index e35a8be6a7..25184b6e3e 100644 --- a/contracts/generated/ManagementContract/ManagementContract.go +++ b/contracts/generated/ManagementContract/ManagementContract.go @@ -62,7 +62,7 @@ type StructsValueTransferMessage struct { // ManagementContractMetaData contains all meta data concerning the ManagementContract contract. var ManagementContractMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"ImportantContractAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"messageBusAddress\",\"type\":\"address\"}],\"name\":\"LogManagementContractCreated\",\"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\":\"enclaveID\",\"type\":\"address\"}],\"name\":\"SequencerEnclaveGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"enclaveID\",\"type\":\"address\"}],\"name\":\"SequencerEnclaveRevoked\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"r\",\"type\":\"tuple\"},{\"internalType\":\"string\",\"name\":\"_rollupData\",\"type\":\"string\"},{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"nonce\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"topic\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"consistencyLevel\",\"type\":\"uint8\"}],\"internalType\":\"structStructs.CrossChainMessage[]\",\"name\":\"messages\",\"type\":\"tuple[]\"}],\"internalType\":\"structStructs.HeaderCrossChainData\",\"name\":\"\",\"type\":\"tuple\"}],\"name\":\"AddRollup\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"Attested\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"sequence\",\"type\":\"uint64\"}],\"internalType\":\"structStructs.ValueTransferMessage\",\"name\":\"_msg\",\"type\":\"tuple\"},{\"internalType\":\"bytes32[]\",\"name\":\"proof\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"name\":\"ExtractNativeValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GetImportantContractKeys\",\"outputs\":[{\"internalType\":\"string[]\",\"name\":\"\",\"type\":\"string[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"rollupHash\",\"type\":\"bytes32\"}],\"name\":\"GetRollupByHash\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"Signature\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"LastSequenceNumber\",\"type\":\"uint256\"}],\"internalType\":\"structStructs.MetaRollup\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"GrantSequencerEnclave\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_enclaveID\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_initSecret\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"_genesisAttestation\",\"type\":\"string\"}],\"name\":\"InitializeNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"IsSequencerEnclave\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IsWithdrawalAvailable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"requestReport\",\"type\":\"string\"}],\"name\":\"RequestNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attesterID\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"requesterID\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"attesterSig\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"responseSecret\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"verifyAttester\",\"type\":\"bool\"}],\"name\":\"RespondNetworkSecret\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RetrieveAllBridgeFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"RevokeSequencerEnclave\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"key\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"SetImportantContractAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_lastBatchHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"crossChainHashes\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"addCrossChainMessagesRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"importantContractAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"importantContractKeys\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"isWithdrawalSpent\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBatchHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastBatchSeqNo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"merkleMessageBus\",\"outputs\":[{\"internalType\":\"contractIMerkleTreeMessageBus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBus\",\"outputs\":[{\"internalType\":\"contractIMessageBus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Bin: "0x608060405234801561001057600080fd5b5061001a3361001f565b610090565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61410c80620000a06000396000f3fe60806040523480156200001157600080fd5b5060043610620001d05760003560e01c8063715018a61162000101578063a1a227fa11620000a3578063db5d91b1116200007a578063db5d91b11462000446578063e34fbfc81462000475578063e874eb20146200048a578063f2fde38b146200049e57600080fd5b8063a1a227fa146200040a578063a52f433c146200041e578063d4fab887146200042f57600080fd5b80638236a7ba11620000d85780638236a7ba146200038c5780638da5cb5b14620003b357806398077e8614620003e457600080fd5b8063715018a6146200036e5780637281099614620003785780638129fc1c146200038257600080fd5b806343348b2f11620001775780635371a216116200014e5780635371a216146200031057806368e1038314620003275780636a30d26c146200033e5780636b9707d6146200035757600080fd5b806343348b2f14620002c0578063440c953b14620002ef5780634766573814620002f957600080fd5b80632f0cb9e311620001ac5780632f0cb9e314620002225780633e60a22f14620002595780633f3f6a1814620002a957600080fd5b80620ddd2714620001d557806303e72e4814620001f25780632c77c81f146200020b575b600080fd5b620001df600a5481565b6040519081526020015b60405180910390f35b620002096200020336600462001be9565b620004b5565b005b620002096200021c36600462001c89565b620005c8565b620002486200023336600462001d2c565b60096020526000908152604090205460ff1681565b6040519015158152602001620001e9565b620002906200026a36600462001d46565b80516020818301810180516003825292820191909301209152546001600160a01b031681565b6040516001600160a01b039091168152602001620001e9565b62000209620002ba36600462001d87565b62000707565b62000248620002d136600462001ea1565b6001600160a01b031660009081526020819052604090205460ff1690565b620001df60055481565b620002096200030a36600462001ea1565b6200098d565b620002096200032136600462001ec6565b62000a5d565b620002096200033836600462001f60565b62000c66565b6200034862000d5d565b604051620001e991906200203e565b620002096200036836600462001ea1565b62000e40565b6200020962000f06565b6200020962000f1e565b6200020962000fa2565b620003a36200039d36600462001d2c565b6200117a565b604051620001e9929190620020a4565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031662000290565b620003fb620003f536600462001d2c565b6200126a565b604051620001e99190620020ea565b60075462000290906001600160a01b031681565b600454610100900460ff1662000248565b6200020962000440366004620020ff565b6200131f565b620002486200045736600462001ea1565b6001600160a01b031660009081526001602052604090205460ff1690565b6200020962000486366004620021aa565b5050565b60085462000290906001600160a01b031681565b62000209620004af36600462001ea1565b620014b2565b620004bf6200150f565b60006001600160a01b0316600383604051620004dc9190620021f0565b908152604051908190036020019020546001600160a01b0316036200053b57600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace016200053983826200229d565b505b806003836040516200054e9190620021f0565b90815260405190819003602001812080546001600160a01b039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092179091557f17b2f9f5748931099ffee882b5b64f4a560b5c55da9b4f4e396dae3bb9f98cb590620005bc90849084906200236a565b60405180910390a15050565b60006200061a8535620005df602088018862002397565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200158692505050565b6001600160a01b03811660009081526020819052604090205490915060ff166200068b5760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f742061747465737465640000000000000000000060448201526064015b60405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff16620006f55760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e63657200000000000000604482015260640162000682565b6200070085620015b6565b5050505050565b620007148460ff620023f7565b431115620007655760405162461bcd60e51b815260206004820152601560248201527f426c6f636b2062696e64696e6720746f6f206f6c640000000000000000000000604482015260640162000682565b84844014620007cc576200077943620015ee565b6200078486620015ee565b620007908640620015ee565b604051602001620007a4939291906200240d565b60408051601f198184030181529082905262461bcd60e51b82526200068291600401620020ea565b60006200083e87878787604051602001620007eb9493929190620024b2565b6040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200158692505050565b6001600160a01b03811660009081526020819052604090205490915060ff16620008ab5760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f7420617474657374656400000000000000000000604482015260640162000682565b600a87905560005b8451811015620009835760085485516001600160a01b039091169063b6aed0cb90879084908110620008e957620008e96200252e565b6020026020010151620008fc9062002544565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526004810191909152426024820152604401600060405180830381600087803b1580156200095457600080fd5b505af115801562000969573d6000803e3d6000fd5b5050505080806200097a9062002569565b915050620008b3565b5050505050505050565b620009976200150f565b6001600160a01b03811660009081526020819052604090205460ff1662000a015760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f7420617474657374656400000000000000000000604482015260640162000682565b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093691015b60405180910390a150565b6008546040517fb201246f0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063b201246f9062000aae908790879087908790600401620025e5565b60006040518083038186803b15801562000ac757600080fd5b505afa15801562000adc573d6000803e3d6000fd5b5050505060008460405160200162000af591906200264d565b60408051601f1981840301815291815281516020928301206000818152600990935291205490915060ff161562000b6f5760405162461bcd60e51b815260206004820152601860248201527f7769746864726177616c20616c7265616479207370656e740000000000000000604482015260640162000682565b6001600960008760405160200162000b8891906200264d565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff1916931515939093179092556007546001600160a01b0316916399a3ad219162000be39190890190890162001ea1565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301528801356024820152604401600060405180830381600087803b15801562000c4657600080fd5b505af115801562000c5b573d6000803e3d6000fd5b505050505050505050565b60045460ff161562000ce15760405162461bcd60e51b815260206004820152602260248201527f6e6574776f726b2073656372657420616c726561647920696e697469616c697a60448201527f6564000000000000000000000000000000000000000000000000000000000000606482015260840162000682565b60048054600160ff1991821681179092556001600160a01b038716600081815260208181526040808320805486168717905585825291829020805490941690941790925590519081527ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093691015b60405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101562000e3757838290600052602060002001805462000da3906200220e565b80601f016020809104026020016040519081016040528092919081815260200182805462000dd1906200220e565b801562000e225780601f1062000df65761010080835404028352916020019162000e22565b820191906000526020600020905b81548152906001019060200180831162000e0457829003601f168201915b50505050508152602001906001019062000d81565b50505050905090565b62000e4a6200150f565b6001600160a01b03811660009081526001602052604090205460ff1662000eb45760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e63657200000000000000604482015260640162000682565b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527f0f279980343c7ca542fde9fa5396555068efb5cd560d9cf9c191aa2911079b47910162000a52565b62000f106200150f565b62000f1c600062001695565b565b62000f286200150f565b6007546040517f36d2da900000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116906336d2da9090602401600060405180830381600087803b15801562000f8757600080fd5b505af115801562000f9c573d6000803e3d6000fd5b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801562000fee5750825b905060008267ffffffffffffffff1660011480156200100c5750303b155b9050811580156200101b575080155b1562001053576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156200108857845468ff00000000000000001916680100000000000000001785555b620010933362001713565b6000600555604051620010a69062001afd565b604051809103906000f080158015620010c3573d6000803e3d6000fd5b506008805473ffffffffffffffffffffffffffffffffffffffff199081166001600160a01b039390931692831790915560078054909116821790556040519081527fbd726cf82ac9c3260b1495107182e336e0654b25c10915648c0cc15b2bb72cbf9060200160405180910390a183156200070057845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200162000d4e565b604080516060808201835260008083526020808401839052838501829052858252600681528482208551938401909552845483526001850180549295869493909284019190620011ca906200220e565b80601f0160208091040260200160405190810160405280929190818152602001828054620011f8906200220e565b8015620012495780601f106200121d5761010080835404028352916020019162001249565b820191906000526020600020905b8154815290600101906020018083116200122b57829003601f168201915b50505091835250506002919091015460209091015280519094149492505050565b600281815481106200127b57600080fd5b90600052602060002001600091509050805462001298906200220e565b80601f0160208091040260200160405190810160405280929190818152602001828054620012c6906200220e565b8015620013175780601f10620012eb5761010080835404028352916020019162001317565b820191906000526020600020905b815481529060010190602001808311620012f957829003601f168201915b505050505081565b6001600160a01b03851660009081526020819052604090205460ff1680620013b05760405162461bcd60e51b815260206004820152602360248201527f726573706f6e64696e67206174746573746572206973206e6f7420617474657360448201527f7465640000000000000000000000000000000000000000000000000000000000606482015260840162000682565b811562001487576000620013e9878786604051602001620013d4939291906200265d565b60405160208183030381529060405262001728565b90506000620013f9828762001586565b9050876001600160a01b0316816001600160a01b031614620014845760405162461bcd60e51b815260206004820152602c60248201527f63616c63756c61746564206164647265737320616e642061747465737465724960448201527f4420646f6e74206d617463680000000000000000000000000000000000000000606482015260840162000682565b50505b5050506001600160a01b039091166000908152602081905260409020805460ff191660011790555050565b620014bc6200150f565b6001600160a01b03811662001501576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240162000682565b6200150c8162001695565b50565b33620015427f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161462000f1c576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240162000682565b60008060008062001598868662001767565b925092509250620015aa8282620017b8565b50909150505b92915050565b803560009081526006602052604090208190620015d48282620026a5565b5050600554604082013511156200150c5760400135600555565b60606000620015fd83620018ce565b600101905060008167ffffffffffffffff81111562001620576200162062001b0b565b6040519080825280601f01601f1916602001820160405280156200164b576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846200165557509392505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6200171d620019b7565b6200150c8162001a1f565b6000620017368251620015ee565b826040516020016200174a929190620027b5565b604051602081830303815290604052805190602001209050919050565b60008060008351604103620017a55760208401516040850151606086015160001a620017968882858562001a29565b955095509550505050620017b1565b50508151600091506002905b9250925092565b6000826003811115620017cf57620017cf62002814565b03620017d9575050565b6001826003811115620017f057620017f062002814565b0362001828576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156200183f576200183f62002814565b036200187b576040517ffce698f70000000000000000000000000000000000000000000000000000000081526004810182905260240162000682565b600382600381111562001892576200189262002814565b0362000486576040517fd78bce0c0000000000000000000000000000000000000000000000000000000081526004810182905260240162000682565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831062001918577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062001945576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200196457662386f26fc10000830492506010015b6305f5e10083106200197d576305f5e100830492506008015b61271083106200199257612710830492506004015b60648310620019a5576064830492506002015b600a8310620015b05760010192915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1662000f1c576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620014bc620019b7565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562001a66575060009150600390508262001af3565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562001abb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662001ae95750600092506001915082905062001af3565b9250600091508190505b9450945094915050565b6118ac806200282b83390190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001b4d5762001b4d62001b0b565b604052919050565b600082601f83011262001b6757600080fd5b813567ffffffffffffffff81111562001b845762001b8462001b0b565b62001b99601f8201601f191660200162001b21565b81815284602083860101111562001baf57600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160a01b038116811462001be457600080fd5b919050565b6000806040838503121562001bfd57600080fd5b823567ffffffffffffffff81111562001c1557600080fd5b62001c238582860162001b55565b92505062001c346020840162001bcc565b90509250929050565b60008083601f84011262001c5057600080fd5b50813567ffffffffffffffff81111562001c6957600080fd5b60208301915083602082850101111562001c8257600080fd5b9250929050565b6000806000806060858703121562001ca057600080fd5b843567ffffffffffffffff8082111562001cb957600080fd5b908601906060828903121562001cce57600080fd5b9094506020860135908082111562001ce557600080fd5b62001cf38883890162001c3d565b9095509350604087013591508082111562001d0d57600080fd5b5085016020818803121562001d2157600080fd5b939692955090935050565b60006020828403121562001d3f57600080fd5b5035919050565b60006020828403121562001d5957600080fd5b813567ffffffffffffffff81111562001d7157600080fd5b62001d7f8482850162001b55565b949350505050565b60008060008060008060a0878903121562001da157600080fd5b86359550602080880135955060408801359450606088013567ffffffffffffffff8082111562001dd057600080fd5b818a0191508a601f83011262001de557600080fd5b81358181111562001dfa5762001dfa62001b0b565b8060051b62001e0b85820162001b21565b918252838101850191858101908e84111562001e2657600080fd5b86860192505b8383101562001e6557848335111562001e4457600080fd5b62001e558f88853589010162001b55565b8252918601919086019062001e2c565b985050505060808a013592508083111562001e7f57600080fd5b505062001e8f89828a0162001c3d565b979a9699509497509295939492505050565b60006020828403121562001eb457600080fd5b62001ebf8262001bcc565b9392505050565b60008060008084860360c081121562001ede57600080fd5b608081121562001eed57600080fd5b50849350608085013567ffffffffffffffff8082111562001f0d57600080fd5b818701915087601f83011262001f2257600080fd5b81358181111562001f3257600080fd5b8860208260051b850101111562001f4857600080fd5b95986020929092019750949560a00135945092505050565b60008060008060006060868803121562001f7957600080fd5b62001f848662001bcc565b9450602086013567ffffffffffffffff8082111562001fa257600080fd5b62001fb089838a0162001c3d565b9096509450604088013591508082111562001fca57600080fd5b5062001fd98882890162001c3d565b969995985093965092949392505050565b60005b838110156200200757818101518382015260200162001fed565b50506000910152565b600081518084526200202a81602086016020860162001fea565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156200209757603f198886030184526200208485835162002010565b9450928501929085019060010162002065565b5092979650505050505050565b8215158152604060208201528151604082015260006020830151606080840152620020d360a084018262002010565b905060408401516080840152809150509392505050565b60208152600062001ebf602083018462002010565b600080600080600060a086880312156200211857600080fd5b620021238662001bcc565b9450620021336020870162001bcc565b9350604086013567ffffffffffffffff808211156200215157600080fd5b6200215f89838a0162001b55565b945060608801359150808211156200217657600080fd5b50620021858882890162001b55565b925050608086013580151581146200219c57600080fd5b809150509295509295909350565b60008060208385031215620021be57600080fd5b823567ffffffffffffffff811115620021d657600080fd5b620021e48582860162001c3d565b90969095509350505050565b600082516200220481846020870162001fea565b9190910192915050565b600181811c908216806200222357607f821691505b6020821081036200224457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200229857600081815260208120601f850160051c81016020861015620022735750805b601f850160051c820191505b8181101562002294578281556001016200227f565b5050505b505050565b815167ffffffffffffffff811115620022ba57620022ba62001b0b565b620022d281620022cb84546200220e565b846200224a565b602080601f8311600181146200230a5760008415620022f15750858301515b600019600386901b1c1916600185901b17855562002294565b600085815260208120601f198616915b828110156200233b578886015182559484019460019091019084016200231a565b50858210156200235a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6040815260006200237f604083018562002010565b90506001600160a01b03831660208301529392505050565b6000808335601e19843603018112620023af57600080fd5b83018035915067ffffffffffffffff821115620023cb57600080fd5b60200191503681900382131562001c8257600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115620015b057620015b0620023e1565b7f496e76616c696420626c6f636b2062696e64696e673a000000000000000000008152600084516200244781601685016020890162001fea565b80830190507f3a00000000000000000000000000000000000000000000000000000000000000806016830152855162002488816017850160208a0162001fea565b60179201918201528351620024a581601884016020880162001fea565b0160180195945050505050565b600060808201868352602086818501528560408501526080606085015281855180845260a08601915060a08160051b870101935082870160005b828110156200251e57609f198887030184526200250b86835162002010565b95509284019290840190600101620024ec565b50939a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b80516020808301519190811015620022445760001960209190910360031b1b16919050565b6000600182016200257e576200257e620023e1565b5060010190565b6001600160a01b0380620025998362001bcc565b16835280620025ab6020840162001bcc565b1660208401525060408101356040830152606081013567ffffffffffffffff8116808214620025d957600080fd5b80606085015250505050565b620025f1818662002585565b60c060808201528260c082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8411156200262e57600080fd5b8360051b808660e085013760a0830193909352500160e0019392505050565b60808101620015b0828462002585565b60006bffffffffffffffffffffffff19808660601b168352808560601b1660148401525082516200269681602885016020870162001fea565b91909101602801949350505050565b813581556001808201602080850135601e19863603018112620026c757600080fd5b8501803567ffffffffffffffff811115620026e157600080fd5b8036038383011315620026f357600080fd5b6200270b816200270486546200220e565b866200224a565b6000601f8211600181146200274457600083156200272b57508382018501355b600019600385901b1c1916600184901b178655620027a0565b600086815260209020601f19841690835b82811015620027765786850188013582559387019390890190870162002755565b5084821015620027965760001960f88660031b161c198785880101351681555b50508683881b0186555b50505050505050604082013560028201555050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351620027ef81601a85016020880162001fea565b8351908301906200280881601a84016020880162001fea565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610046565b50610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611807806100a56000396000f3fe6080604052600436106100e15760003560e01c80639730886d1161007f578063b201246f11610059578063b201246f1461030e578063b6aed0cb1461032e578063e138a8d21461034e578063f2fde38b1461036e57610155565b80639730886d1461029557806399a3ad21146102b5578063b1454caa146102d557610155565b8063346633fb116100bb578063346633fb1461022557806336d2da9014610238578063715018a6146102585780638da5cb5b1461026d57610155565b80630fcfbd11146101a25780630fe9188e146101d557806333a88c72146101f557610155565b36610155576040517f346633fb0000000000000000000000000000000000000000000000000000000081523360048201523460248201819052309163346633fb91906044016000604051808303818588803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b005b60405162461bcd60e51b815260206004820152600b60248201527f756e737570706f7274656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b3480156101ae57600080fd5b506101c26101bd366004610f80565b61038e565b6040519081526020015b60405180910390f35b3480156101e157600080fd5b506101536101f0366004610fb5565b610428565b34801561020157600080fd5b50610215610210366004610f80565b61049e565b60405190151581526020016101cc565b610153610233366004610fe3565b6104f1565b34801561024457600080fd5b5061015361025336600461100f565b6105d4565b34801561026457600080fd5b50610153610683565b34801561027957600080fd5b506000546040516001600160a01b0390911681526020016101cc565b3480156102a157600080fd5b506101536102b036600461102c565b610697565b3480156102c157600080fd5b506101536102d0366004610fe3565b6107e9565b3480156102e157600080fd5b506102f56102f03660046110a2565b610899565b60405167ffffffffffffffff90911681526020016101cc565b34801561031a57600080fd5b5061015361032936600461119b565b6108fa565b34801561033a57600080fd5b506101536103493660046111fd565b610afc565b34801561035a57600080fd5b5061015361036936600461121f565b610b98565b34801561037a57600080fd5b5061015361038936600461100f565b610d78565b600080826040516020016103a291906112ce565b60408051601f19818403018152918152815160209283012060008181526001909352912054909150806104215760405162461bcd60e51b815260206004820152602160248201527f54686973206d65737361676520776173206e65766572207375626d69747465646044820152601760f91b6064820152608401610199565b9392505050565b610430610dcf565b600081815260046020526040812054900361048d5760405162461bcd60e51b815260206004820152601a60248201527f537461746520726f6f7420646f6573206e6f742065786973742e0000000000006044820152606401610199565b600090815260046020526040812055565b600080826040516020016104b291906112ce565b60408051601f1981840301815291815281516020928301206000818152600190935291205490915080158015906104e95750428111155b949350505050565b60003411801561050057508034145b6105725760405162461bcd60e51b815260206004820152603060248201527f417474656d7074696e6720746f2073656e642076616c756520776974686f757460448201527f2070726f766964696e67204574686572000000000000000000000000000000006064820152608401610199565b600061057d33610e15565b6040805134815267ffffffffffffffff831660208201529192506001600160a01b0385169133917f50c536ac33a920f00755865b831d17bf4cff0b2e0345f65b16d52bfc004068b6910160405180910390a3505050565b6105dc610dcf565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610629576040519150601f19603f3d011682016040523d82523d6000602084013e61062e565b606091505b505090508061067f5760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c75650000000000000000000000006044820152606401610199565b5050565b61068b610dcf565b6106956000610e73565b565b61069f610dcf565b60006106ab82426113cf565b90506000836040516020016106c091906112ce565b60408051601f198184030181529181528151602092830120600081815260019093529120549091501561075b5760405162461bcd60e51b815260206004820152602160248201527f4d657373616765207375626d6974746564206d6f7265207468616e206f6e636560448201527f21000000000000000000000000000000000000000000000000000000000000006064820152608401610199565b600081815260016020908152604082208490556002919061077e9087018761100f565b6001600160a01b0316815260208101919091526040016000908120906107aa60808701606088016113e2565b63ffffffff168152602080820192909252604001600090812080546001810182559082529190208591600402016107e182826115b0565b505050505050565b6107f1610dcf565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461083e576040519150601f19603f3d011682016040523d82523d6000602084013e610843565b606091505b50509050806108945760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c75650000000000000000000000006044820152606401610199565b505050565b60006108a433610e15565b9050336001600160a01b03167fb93c37389233beb85a3a726c3f15c2d15533ee74cb602f20f490dfffef7759378288888888886040516108e9969594939291906116ca565b60405180910390a295945050505050565b600081815260046020526040812054900361096a5760405162461bcd60e51b815260206004820152602a60248201527f526f6f74206973206e6f74207075626c6973686564206f6e2074686973206d6560448201526939b9b0b3b290313ab99760b11b6064820152608401610199565b6000818152600460205260409020544210156109d25760405162461bcd60e51b815260206004820152602160248201527f526f6f74206973206e6f7420636f6e736964657265642066696e616c207965746044820152601760f91b6064820152608401610199565b6000846040516020016109e5919061171a565b60408051601f198184030181528282528051602091820120908301829052600160608401527f760000000000000000000000000000000000000000000000000000000000000060808401529082015260a001604051602081830303815290604052805190602001209050610a8384848484604051602001610a6891815260200190565b60405160208183030381529060405280519060200120610ed0565b610af55760405162461bcd60e51b815260206004820152603360248201527f496e76616c696420696e636c7573696f6e2070726f6f6620666f722076616c7560448201527f65207472616e73666572206d6573736167652e000000000000000000000000006064820152608401610199565b5050505050565b610b04610dcf565b60008281526004602052604090205415610b865760405162461bcd60e51b815260206004820152602560248201527f526f6f7420616c726561647920616464656420746f20746865206d657373616760448201527f65206275730000000000000000000000000000000000000000000000000000006064820152608401610199565b60009182526004602052604090912055565b6000818152600460205260408120549003610c085760405162461bcd60e51b815260206004820152602a60248201527f526f6f74206973206e6f74207075626c6973686564206f6e2074686973206d6560448201526939b9b0b3b290313ab99760b11b6064820152608401610199565b600081815260046020526040902054421015610c705760405162461bcd60e51b815260206004820152602160248201527f526f6f74206973206e6f7420636f6e736964657265642066696e616c207965746044820152601760f91b6064820152608401610199565b600084604051602001610c8391906112ce565b60408051601f198184030181528282528051602091820120908301829052600160608401527f6d0000000000000000000000000000000000000000000000000000000000000060808401529082015260a001604051602081830303815290604052805190602001209050610d0684848484604051602001610a6891815260200190565b610af55760405162461bcd60e51b815260206004820152603060248201527f496e76616c696420696e636c7573696f6e2070726f6f6620666f722063726f7360448201527f7320636861696e206d6573736167652e000000000000000000000000000000006064820152608401610199565b610d80610dcf565b6001600160a01b038116610dc3576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610199565b610dcc81610e73565b50565b6000546001600160a01b03163314610695576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610199565b6001600160a01b0381166000908152600360205260408120805467ffffffffffffffff169160019190610e48838561177a565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550919050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610ede868685610ee8565b1495945050505050565b600081815b84811015610f2b57610f1782878784818110610f0b57610f0b6117a2565b90506020020135610f34565b915080610f23816117b8565b915050610eed565b50949350505050565b6000818310610f50576000828152602084905260409020610f5f565b60008381526020839052604090205b90505b92915050565b600060c08284031215610f7a57600080fd5b50919050565b600060208284031215610f9257600080fd5b813567ffffffffffffffff811115610fa957600080fd5b6104e984828501610f68565b600060208284031215610fc757600080fd5b5035919050565b6001600160a01b0381168114610dcc57600080fd5b60008060408385031215610ff657600080fd5b823561100181610fce565b946020939093013593505050565b60006020828403121561102157600080fd5b813561042181610fce565b6000806040838503121561103f57600080fd5b823567ffffffffffffffff81111561105657600080fd5b61106285828601610f68565b95602094909401359450505050565b63ffffffff81168114610dcc57600080fd5b60ff81168114610dcc57600080fd5b803561109d81611083565b919050565b6000806000806000608086880312156110ba57600080fd5b85356110c581611071565b945060208601356110d581611071565b9350604086013567ffffffffffffffff808211156110f257600080fd5b818801915088601f83011261110657600080fd5b81358181111561111557600080fd5b89602082850101111561112757600080fd5b602083019550809450505050606086013561114181611083565b809150509295509295909350565b60008083601f84011261116157600080fd5b50813567ffffffffffffffff81111561117957600080fd5b6020830191508360208260051b850101111561119457600080fd5b9250929050565b60008060008084860360c08112156111b257600080fd5b60808112156111c057600080fd5b50849350608085013567ffffffffffffffff8111156111de57600080fd5b6111ea8782880161114f565b9598909750949560a00135949350505050565b6000806040838503121561121057600080fd5b50508035926020909101359150565b6000806000806060858703121561123557600080fd5b843567ffffffffffffffff8082111561124d57600080fd5b61125988838901610f68565b9550602087013591508082111561126f57600080fd5b5061127c8782880161114f565b9598909750949560400135949350505050565b67ffffffffffffffff81168114610dcc57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600082356112df81610fce565b6001600160a01b03811660208401525060208301356112fd8161128f565b67ffffffffffffffff80821660408501526040850135915061131e82611071565b63ffffffff80831660608601526060860135925061133b83611071565b80831660808601525060808501359150601e1985360301821261135d57600080fd5b602091850191820191358181111561137457600080fd5b80360383131561138357600080fd5b60c060a086015261139860e0860182856112a5565b925050506113a860a08501611092565b60ff811660c0850152509392505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610f6257610f626113b9565b6000602082840312156113f457600080fd5b813561042181611071565b60008135610f6281611071565b6000808335601e1984360301811261142357600080fd5b83018035915067ffffffffffffffff82111561143e57600080fd5b60200191503681900382131561119457600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061147d57607f821691505b602082108103610f7a57634e487b7160e01b600052602260045260246000fd5b601f82111561089457600081815260208120601f850160051c810160208610156114c45750805b601f850160051c820191505b818110156107e1578281556001016114d0565b67ffffffffffffffff8311156114fb576114fb611453565b61150f836115098354611469565b8361149d565b6000601f841160018114611543576000851561152b5750838201355b600019600387901b1c1916600186901b178355610af5565b600083815260209020601f19861690835b828110156115745786850135825560209485019460019092019101611554565b50868210156115915760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008135610f6281611083565b81356115bb81610fce565b6001600160a01b038116905081548173ffffffffffffffffffffffffffffffffffffffff19821617835560208401356115f38161128f565b7bffffffffffffffff00000000000000000000000000000000000000008160a01b1690507fffffffff000000000000000000000000000000000000000000000000000000008184828516171785556040860135925061165183611071565b921760e09190911b90911617815561168961166e606084016113ff565b6001830163ffffffff821663ffffffff198254161781555050565b611696608083018361140c565b6116a48183600286016114e3565b505061067f6116b560a084016115a3565b6003830160ff821660ff198254161781555050565b67ffffffffffffffff87168152600063ffffffff808816602084015280871660408401525060a0606083015261170460a0830185876112a5565b905060ff83166080830152979650505050505050565b60808101823561172981610fce565b6001600160a01b03908116835260208401359061174582610fce565b1660208301526040838101359083015260608301356117638161128f565b67ffffffffffffffff811660608401525092915050565b67ffffffffffffffff81811683821601908082111561179b5761179b6113b9565b5092915050565b634e487b7160e01b600052603260045260246000fd5b6000600182016117ca576117ca6113b9565b506001019056fea2646970667358221220a449a197632e1117b118ced8f7cf97a1ae44b160775ee146e59b50cbc1b8dcaa64736f6c63430008140033a26469706673582212202fd617a3630cf681ce12689bd4aaaf5790a425dc0c5df74df3f3292e687bfb1b64736f6c63430008140033", + Bin: "0x608060405234801561001057600080fd5b5061001a3361001f565b610090565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61410c80620000a06000396000f3fe60806040523480156200001157600080fd5b5060043610620001d05760003560e01c8063715018a61162000101578063a1a227fa11620000a3578063db5d91b1116200007a578063db5d91b11462000446578063e34fbfc81462000475578063e874eb20146200048a578063f2fde38b146200049e57600080fd5b8063a1a227fa146200040a578063a52f433c146200041e578063d4fab887146200042f57600080fd5b80638236a7ba11620000d85780638236a7ba146200038c5780638da5cb5b14620003b357806398077e8614620003e457600080fd5b8063715018a6146200036e5780637281099614620003785780638129fc1c146200038257600080fd5b806343348b2f11620001775780635371a216116200014e5780635371a216146200031057806368e1038314620003275780636a30d26c146200033e5780636b9707d6146200035757600080fd5b806343348b2f14620002c0578063440c953b14620002ef5780634766573814620002f957600080fd5b80632f0cb9e311620001ac5780632f0cb9e314620002225780633e60a22f14620002595780633f3f6a1814620002a957600080fd5b80620ddd2714620001d557806303e72e4814620001f25780632c77c81f146200020b575b600080fd5b620001df600a5481565b6040519081526020015b60405180910390f35b620002096200020336600462001be9565b620004b5565b005b620002096200021c36600462001c89565b620005c8565b620002486200023336600462001d2c565b60096020526000908152604090205460ff1681565b6040519015158152602001620001e9565b620002906200026a36600462001d46565b80516020818301810180516003825292820191909301209152546001600160a01b031681565b6040516001600160a01b039091168152602001620001e9565b62000209620002ba36600462001d87565b62000707565b62000248620002d136600462001ea1565b6001600160a01b031660009081526020819052604090205460ff1690565b620001df60055481565b620002096200030a36600462001ea1565b6200098d565b620002096200032136600462001ec6565b62000a5d565b620002096200033836600462001f60565b62000c66565b6200034862000d5d565b604051620001e991906200203e565b620002096200036836600462001ea1565b62000e40565b6200020962000f06565b6200020962000f1e565b6200020962000fa2565b620003a36200039d36600462001d2c565b6200117a565b604051620001e9929190620020a4565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031662000290565b620003fb620003f536600462001d2c565b6200126a565b604051620001e99190620020ea565b60075462000290906001600160a01b031681565b600454610100900460ff1662000248565b6200020962000440366004620020ff565b6200131f565b620002486200045736600462001ea1565b6001600160a01b031660009081526001602052604090205460ff1690565b6200020962000486366004620021aa565b5050565b60085462000290906001600160a01b031681565b62000209620004af36600462001ea1565b620014b2565b620004bf6200150f565b60006001600160a01b0316600383604051620004dc9190620021f0565b908152604051908190036020019020546001600160a01b0316036200053b57600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace016200053983826200229d565b505b806003836040516200054e9190620021f0565b90815260405190819003602001812080546001600160a01b039390931673ffffffffffffffffffffffffffffffffffffffff19909316929092179091557f17b2f9f5748931099ffee882b5b64f4a560b5c55da9b4f4e396dae3bb9f98cb590620005bc90849084906200236a565b60405180910390a15050565b60006200061a8535620005df602088018862002397565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200158692505050565b6001600160a01b03811660009081526020819052604090205490915060ff166200068b5760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f742061747465737465640000000000000000000060448201526064015b60405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff16620006f55760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e63657200000000000000604482015260640162000682565b6200070085620015b6565b5050505050565b620007148460ff620023f7565b431115620007655760405162461bcd60e51b815260206004820152601560248201527f426c6f636b2062696e64696e6720746f6f206f6c640000000000000000000000604482015260640162000682565b84844014620007cc576200077943620015ee565b6200078486620015ee565b620007908640620015ee565b604051602001620007a4939291906200240d565b60408051601f198184030181529082905262461bcd60e51b82526200068291600401620020ea565b60006200083e87878787604051602001620007eb9493929190620024b2565b6040516020818303038152906040528051906020012084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506200158692505050565b6001600160a01b03811660009081526020819052604090205490915060ff16620008ab5760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f7420617474657374656400000000000000000000604482015260640162000682565b600a87905560005b8451811015620009835760085485516001600160a01b039091169063b6aed0cb90879084908110620008e957620008e96200252e565b6020026020010151620008fc9062002544565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526004810191909152426024820152604401600060405180830381600087803b1580156200095457600080fd5b505af115801562000969573d6000803e3d6000fd5b5050505080806200097a9062002569565b915050620008b3565b5050505050505050565b620009976200150f565b6001600160a01b03811660009081526020819052604090205460ff1662000a015760405162461bcd60e51b815260206004820152601660248201527f656e636c6176654944206e6f7420617474657374656400000000000000000000604482015260640162000682565b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093691015b60405180910390a150565b6008546040517fb201246f0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063b201246f9062000aae908790879087908790600401620025e5565b60006040518083038186803b15801562000ac757600080fd5b505afa15801562000adc573d6000803e3d6000fd5b5050505060008460405160200162000af591906200264d565b60408051601f1981840301815291815281516020928301206000818152600990935291205490915060ff161562000b6f5760405162461bcd60e51b815260206004820152601860248201527f7769746864726177616c20616c7265616479207370656e740000000000000000604482015260640162000682565b6001600960008760405160200162000b8891906200264d565b60408051808303601f190181529181528151602092830120835282820193909352908201600020805460ff1916931515939093179092556007546001600160a01b0316916399a3ad219162000be39190890190890162001ea1565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301528801356024820152604401600060405180830381600087803b15801562000c4657600080fd5b505af115801562000c5b573d6000803e3d6000fd5b505050505050505050565b60045460ff161562000ce15760405162461bcd60e51b815260206004820152602260248201527f6e6574776f726b2073656372657420616c726561647920696e697469616c697a60448201527f6564000000000000000000000000000000000000000000000000000000000000606482015260840162000682565b60048054600160ff1991821681179092556001600160a01b038716600081815260208181526040808320805486168717905585825291829020805490941690941790925590519081527ffe64c7181f0fc60e300dc02cca368cdfa94d7ca45902de3b9a9d80070e76093691015b60405180910390a15050505050565b60606002805480602002602001604051908101604052809291908181526020016000905b8282101562000e3757838290600052602060002001805462000da3906200220e565b80601f016020809104026020016040519081016040528092919081815260200182805462000dd1906200220e565b801562000e225780601f1062000df65761010080835404028352916020019162000e22565b820191906000526020600020905b81548152906001019060200180831162000e0457829003601f168201915b50505050508152602001906001019062000d81565b50505050905090565b62000e4a6200150f565b6001600160a01b03811660009081526001602052604090205460ff1662000eb45760405162461bcd60e51b815260206004820152601960248201527f656e636c6176654944206e6f7420612073657175656e63657200000000000000604482015260640162000682565b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527f0f279980343c7ca542fde9fa5396555068efb5cd560d9cf9c191aa2911079b47910162000a52565b62000f106200150f565b62000f1c600062001695565b565b62000f286200150f565b6007546040517f36d2da900000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03909116906336d2da9090602401600060405180830381600087803b15801562000f8757600080fd5b505af115801562000f9c573d6000803e3d6000fd5b50505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff1660008115801562000fee5750825b905060008267ffffffffffffffff1660011480156200100c5750303b155b9050811580156200101b575080155b1562001053576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156200108857845468ff00000000000000001916680100000000000000001785555b620010933362001713565b6000600555604051620010a69062001afd565b604051809103906000f080158015620010c3573d6000803e3d6000fd5b506008805473ffffffffffffffffffffffffffffffffffffffff199081166001600160a01b039390931692831790915560078054909116821790556040519081527fbd726cf82ac9c3260b1495107182e336e0654b25c10915648c0cc15b2bb72cbf9060200160405180910390a183156200070057845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200162000d4e565b604080516060808201835260008083526020808401839052838501829052858252600681528482208551938401909552845483526001850180549295869493909284019190620011ca906200220e565b80601f0160208091040260200160405190810160405280929190818152602001828054620011f8906200220e565b8015620012495780601f106200121d5761010080835404028352916020019162001249565b820191906000526020600020905b8154815290600101906020018083116200122b57829003601f168201915b50505091835250506002919091015460209091015280519094149492505050565b600281815481106200127b57600080fd5b90600052602060002001600091509050805462001298906200220e565b80601f0160208091040260200160405190810160405280929190818152602001828054620012c6906200220e565b8015620013175780601f10620012eb5761010080835404028352916020019162001317565b820191906000526020600020905b815481529060010190602001808311620012f957829003601f168201915b505050505081565b6001600160a01b03851660009081526020819052604090205460ff1680620013b05760405162461bcd60e51b815260206004820152602360248201527f726573706f6e64696e67206174746573746572206973206e6f7420617474657360448201527f7465640000000000000000000000000000000000000000000000000000000000606482015260840162000682565b811562001487576000620013e9878786604051602001620013d4939291906200265d565b60405160208183030381529060405262001728565b90506000620013f9828762001586565b9050876001600160a01b0316816001600160a01b031614620014845760405162461bcd60e51b815260206004820152602c60248201527f63616c63756c61746564206164647265737320616e642061747465737465724960448201527f4420646f6e74206d617463680000000000000000000000000000000000000000606482015260840162000682565b50505b5050506001600160a01b039091166000908152602081905260409020805460ff191660011790555050565b620014bc6200150f565b6001600160a01b03811662001501576040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526000600482015260240162000682565b6200150c8162001695565b50565b33620015427f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161462000f1c576040517f118cdaa700000000000000000000000000000000000000000000000000000000815233600482015260240162000682565b60008060008062001598868662001767565b925092509250620015aa8282620017b8565b50909150505b92915050565b803560009081526006602052604090208190620015d48282620026a5565b5050600554604082013511156200150c5760400135600555565b60606000620015fd83620018ce565b600101905060008167ffffffffffffffff81111562001620576200162062001b0b565b6040519080825280601f01601f1916602001820160405280156200164b576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846200165557509392505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300805473ffffffffffffffffffffffffffffffffffffffff1981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6200171d620019b7565b6200150c8162001a1f565b6000620017368251620015ee565b826040516020016200174a929190620027b5565b604051602081830303815290604052805190602001209050919050565b60008060008351604103620017a55760208401516040850151606086015160001a620017968882858562001a29565b955095509550505050620017b1565b50508151600091506002905b9250925092565b6000826003811115620017cf57620017cf62002814565b03620017d9575050565b6001826003811115620017f057620017f062002814565b0362001828576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156200183f576200183f62002814565b036200187b576040517ffce698f70000000000000000000000000000000000000000000000000000000081526004810182905260240162000682565b600382600381111562001892576200189262002814565b0362000486576040517fd78bce0c0000000000000000000000000000000000000000000000000000000081526004810182905260240162000682565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831062001918577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062001945576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200196457662386f26fc10000830492506010015b6305f5e10083106200197d576305f5e100830492506008015b61271083106200199257612710830492506004015b60648310620019a5576064830492506002015b600a8310620015b05760010192915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1662000f1c576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620014bc620019b7565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562001a66575060009150600390508262001af3565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562001abb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811662001ae95750600092506001915082905062001af3565b9250600091508190505b9450945094915050565b6118ac806200282b83390190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171562001b4d5762001b4d62001b0b565b604052919050565b600082601f83011262001b6757600080fd5b813567ffffffffffffffff81111562001b845762001b8462001b0b565b62001b99601f8201601f191660200162001b21565b81815284602083860101111562001baf57600080fd5b816020850160208301376000918101602001919091529392505050565b80356001600160a01b038116811462001be457600080fd5b919050565b6000806040838503121562001bfd57600080fd5b823567ffffffffffffffff81111562001c1557600080fd5b62001c238582860162001b55565b92505062001c346020840162001bcc565b90509250929050565b60008083601f84011262001c5057600080fd5b50813567ffffffffffffffff81111562001c6957600080fd5b60208301915083602082850101111562001c8257600080fd5b9250929050565b6000806000806060858703121562001ca057600080fd5b843567ffffffffffffffff8082111562001cb957600080fd5b908601906060828903121562001cce57600080fd5b9094506020860135908082111562001ce557600080fd5b62001cf38883890162001c3d565b9095509350604087013591508082111562001d0d57600080fd5b5085016020818803121562001d2157600080fd5b939692955090935050565b60006020828403121562001d3f57600080fd5b5035919050565b60006020828403121562001d5957600080fd5b813567ffffffffffffffff81111562001d7157600080fd5b62001d7f8482850162001b55565b949350505050565b60008060008060008060a0878903121562001da157600080fd5b86359550602080880135955060408801359450606088013567ffffffffffffffff8082111562001dd057600080fd5b818a0191508a601f83011262001de557600080fd5b81358181111562001dfa5762001dfa62001b0b565b8060051b62001e0b85820162001b21565b918252838101850191858101908e84111562001e2657600080fd5b86860192505b8383101562001e6557848335111562001e4457600080fd5b62001e558f88853589010162001b55565b8252918601919086019062001e2c565b985050505060808a013592508083111562001e7f57600080fd5b505062001e8f89828a0162001c3d565b979a9699509497509295939492505050565b60006020828403121562001eb457600080fd5b62001ebf8262001bcc565b9392505050565b60008060008084860360c081121562001ede57600080fd5b608081121562001eed57600080fd5b50849350608085013567ffffffffffffffff8082111562001f0d57600080fd5b818701915087601f83011262001f2257600080fd5b81358181111562001f3257600080fd5b8860208260051b850101111562001f4857600080fd5b95986020929092019750949560a00135945092505050565b60008060008060006060868803121562001f7957600080fd5b62001f848662001bcc565b9450602086013567ffffffffffffffff8082111562001fa257600080fd5b62001fb089838a0162001c3d565b9096509450604088013591508082111562001fca57600080fd5b5062001fd98882890162001c3d565b969995985093965092949392505050565b60005b838110156200200757818101518382015260200162001fed565b50506000910152565b600081518084526200202a81602086016020860162001fea565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156200209757603f198886030184526200208485835162002010565b9450928501929085019060010162002065565b5092979650505050505050565b8215158152604060208201528151604082015260006020830151606080840152620020d360a084018262002010565b905060408401516080840152809150509392505050565b60208152600062001ebf602083018462002010565b600080600080600060a086880312156200211857600080fd5b620021238662001bcc565b9450620021336020870162001bcc565b9350604086013567ffffffffffffffff808211156200215157600080fd5b6200215f89838a0162001b55565b945060608801359150808211156200217657600080fd5b50620021858882890162001b55565b925050608086013580151581146200219c57600080fd5b809150509295509295909350565b60008060208385031215620021be57600080fd5b823567ffffffffffffffff811115620021d657600080fd5b620021e48582860162001c3d565b90969095509350505050565b600082516200220481846020870162001fea565b9190910192915050565b600181811c908216806200222357607f821691505b6020821081036200224457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200229857600081815260208120601f850160051c81016020861015620022735750805b601f850160051c820191505b8181101562002294578281556001016200227f565b5050505b505050565b815167ffffffffffffffff811115620022ba57620022ba62001b0b565b620022d281620022cb84546200220e565b846200224a565b602080601f8311600181146200230a5760008415620022f15750858301515b600019600386901b1c1916600185901b17855562002294565b600085815260208120601f198616915b828110156200233b578886015182559484019460019091019084016200231a565b50858210156200235a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6040815260006200237f604083018562002010565b90506001600160a01b03831660208301529392505050565b6000808335601e19843603018112620023af57600080fd5b83018035915067ffffffffffffffff821115620023cb57600080fd5b60200191503681900382131562001c8257600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115620015b057620015b0620023e1565b7f496e76616c696420626c6f636b2062696e64696e673a000000000000000000008152600084516200244781601685016020890162001fea565b80830190507f3a00000000000000000000000000000000000000000000000000000000000000806016830152855162002488816017850160208a0162001fea565b60179201918201528351620024a581601884016020880162001fea565b0160180195945050505050565b600060808201868352602086818501528560408501526080606085015281855180845260a08601915060a08160051b870101935082870160005b828110156200251e57609f198887030184526200250b86835162002010565b95509284019290840190600101620024ec565b50939a9950505050505050505050565b634e487b7160e01b600052603260045260246000fd5b80516020808301519190811015620022445760001960209190910360031b1b16919050565b6000600182016200257e576200257e620023e1565b5060010190565b6001600160a01b0380620025998362001bcc565b16835280620025ab6020840162001bcc565b1660208401525060408101356040830152606081013567ffffffffffffffff8116808214620025d957600080fd5b80606085015250505050565b620025f1818662002585565b60c060808201528260c082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8411156200262e57600080fd5b8360051b808660e085013760a0830193909352500160e0019392505050565b60808101620015b0828462002585565b60006bffffffffffffffffffffffff19808660601b168352808560601b1660148401525082516200269681602885016020870162001fea565b91909101602801949350505050565b813581556001808201602080850135601e19863603018112620026c757600080fd5b8501803567ffffffffffffffff811115620026e157600080fd5b8036038383011315620026f357600080fd5b6200270b816200270486546200220e565b866200224a565b6000601f8211600181146200274457600083156200272b57508382018501355b600019600385901b1c1916600184901b178655620027a0565b600086815260209020601f19841690835b82811015620027765786850188013582559387019390890190870162002755565b5084821015620027965760001960f88660031b161c198785880101351681555b50508683881b0186555b50505050505050604082013560028201555050565b7f19457468657265756d205369676e6564204d6573736167653a0a000000000000815260008351620027ef81601a85016020880162001fea565b8351908301906200280881601a84016020880162001fea565b01601a01949350505050565b634e487b7160e01b600052602160045260246000fdfe608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610046565b50610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611807806100a56000396000f3fe6080604052600436106100e15760003560e01c80639730886d1161007f578063b201246f11610059578063b201246f1461030e578063b6aed0cb1461032e578063e138a8d21461034e578063f2fde38b1461036e57610155565b80639730886d1461029557806399a3ad21146102b5578063b1454caa146102d557610155565b8063346633fb116100bb578063346633fb1461022557806336d2da9014610238578063715018a6146102585780638da5cb5b1461026d57610155565b80630fcfbd11146101a25780630fe9188e146101d557806333a88c72146101f557610155565b36610155576040517f346633fb0000000000000000000000000000000000000000000000000000000081523360048201523460248201819052309163346633fb91906044016000604051808303818588803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b005b60405162461bcd60e51b815260206004820152600b60248201527f756e737570706f7274656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b3480156101ae57600080fd5b506101c26101bd366004610f80565b61038e565b6040519081526020015b60405180910390f35b3480156101e157600080fd5b506101536101f0366004610fb5565b610428565b34801561020157600080fd5b50610215610210366004610f80565b61049e565b60405190151581526020016101cc565b610153610233366004610fe3565b6104f1565b34801561024457600080fd5b5061015361025336600461100f565b6105d4565b34801561026457600080fd5b50610153610683565b34801561027957600080fd5b506000546040516001600160a01b0390911681526020016101cc565b3480156102a157600080fd5b506101536102b036600461102c565b610697565b3480156102c157600080fd5b506101536102d0366004610fe3565b6107e9565b3480156102e157600080fd5b506102f56102f03660046110a2565b610899565b60405167ffffffffffffffff90911681526020016101cc565b34801561031a57600080fd5b5061015361032936600461119b565b6108fa565b34801561033a57600080fd5b506101536103493660046111fd565b610afc565b34801561035a57600080fd5b5061015361036936600461121f565b610b98565b34801561037a57600080fd5b5061015361038936600461100f565b610d78565b600080826040516020016103a291906112ce565b60408051601f19818403018152918152815160209283012060008181526001909352912054909150806104215760405162461bcd60e51b815260206004820152602160248201527f54686973206d65737361676520776173206e65766572207375626d69747465646044820152601760f91b6064820152608401610199565b9392505050565b610430610dcf565b600081815260046020526040812054900361048d5760405162461bcd60e51b815260206004820152601a60248201527f537461746520726f6f7420646f6573206e6f742065786973742e0000000000006044820152606401610199565b600090815260046020526040812055565b600080826040516020016104b291906112ce565b60408051601f1981840301815291815281516020928301206000818152600190935291205490915080158015906104e95750428111155b949350505050565b60003411801561050057508034145b6105725760405162461bcd60e51b815260206004820152603060248201527f417474656d7074696e6720746f2073656e642076616c756520776974686f757460448201527f2070726f766964696e67204574686572000000000000000000000000000000006064820152608401610199565b600061057d33610e15565b6040805134815267ffffffffffffffff831660208201529192506001600160a01b0385169133917f50c536ac33a920f00755865b831d17bf4cff0b2e0345f65b16d52bfc004068b6910160405180910390a3505050565b6105dc610dcf565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610629576040519150601f19603f3d011682016040523d82523d6000602084013e61062e565b606091505b505090508061067f5760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c75650000000000000000000000006044820152606401610199565b5050565b61068b610dcf565b6106956000610e73565b565b61069f610dcf565b60006106ab82426113cf565b90506000836040516020016106c091906112ce565b60408051601f198184030181529181528151602092830120600081815260019093529120549091501561075b5760405162461bcd60e51b815260206004820152602160248201527f4d657373616765207375626d6974746564206d6f7265207468616e206f6e636560448201527f21000000000000000000000000000000000000000000000000000000000000006064820152608401610199565b600081815260016020908152604082208490556002919061077e9087018761100f565b6001600160a01b0316815260208101919091526040016000908120906107aa60808701606088016113e2565b63ffffffff168152602080820192909252604001600090812080546001810182559082529190208591600402016107e182826115b0565b505050505050565b6107f1610dcf565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461083e576040519150601f19603f3d011682016040523d82523d6000602084013e610843565b606091505b50509050806108945760405162461bcd60e51b815260206004820152601460248201527f6661696c65642073656e64696e672076616c75650000000000000000000000006044820152606401610199565b505050565b60006108a433610e15565b9050336001600160a01b03167fb93c37389233beb85a3a726c3f15c2d15533ee74cb602f20f490dfffef7759378288888888886040516108e9969594939291906116ca565b60405180910390a295945050505050565b600081815260046020526040812054900361096a5760405162461bcd60e51b815260206004820152602a60248201527f526f6f74206973206e6f74207075626c6973686564206f6e2074686973206d6560448201526939b9b0b3b290313ab99760b11b6064820152608401610199565b6000818152600460205260409020544210156109d25760405162461bcd60e51b815260206004820152602160248201527f526f6f74206973206e6f7420636f6e736964657265642066696e616c207965746044820152601760f91b6064820152608401610199565b6000846040516020016109e5919061171a565b60408051601f198184030181528282528051602091820120908301829052600160608401527f760000000000000000000000000000000000000000000000000000000000000060808401529082015260a001604051602081830303815290604052805190602001209050610a8384848484604051602001610a6891815260200190565b60405160208183030381529060405280519060200120610ed0565b610af55760405162461bcd60e51b815260206004820152603360248201527f496e76616c696420696e636c7573696f6e2070726f6f6620666f722076616c7560448201527f65207472616e73666572206d6573736167652e000000000000000000000000006064820152608401610199565b5050505050565b610b04610dcf565b60008281526004602052604090205415610b865760405162461bcd60e51b815260206004820152602560248201527f526f6f7420616c726561647920616464656420746f20746865206d657373616760448201527f65206275730000000000000000000000000000000000000000000000000000006064820152608401610199565b60009182526004602052604090912055565b6000818152600460205260408120549003610c085760405162461bcd60e51b815260206004820152602a60248201527f526f6f74206973206e6f74207075626c6973686564206f6e2074686973206d6560448201526939b9b0b3b290313ab99760b11b6064820152608401610199565b600081815260046020526040902054421015610c705760405162461bcd60e51b815260206004820152602160248201527f526f6f74206973206e6f7420636f6e736964657265642066696e616c207965746044820152601760f91b6064820152608401610199565b600084604051602001610c8391906112ce565b60408051601f198184030181528282528051602091820120908301829052600160608401527f6d0000000000000000000000000000000000000000000000000000000000000060808401529082015260a001604051602081830303815290604052805190602001209050610d0684848484604051602001610a6891815260200190565b610af55760405162461bcd60e51b815260206004820152603060248201527f496e76616c696420696e636c7573696f6e2070726f6f6620666f722063726f7360448201527f7320636861696e206d6573736167652e000000000000000000000000000000006064820152608401610199565b610d80610dcf565b6001600160a01b038116610dc3576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610199565b610dcc81610e73565b50565b6000546001600160a01b03163314610695576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610199565b6001600160a01b0381166000908152600360205260408120805467ffffffffffffffff169160019190610e48838561177a565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550919050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610ede868685610ee8565b1495945050505050565b600081815b84811015610f2b57610f1782878784818110610f0b57610f0b6117a2565b90506020020135610f34565b915080610f23816117b8565b915050610eed565b50949350505050565b6000818310610f50576000828152602084905260409020610f5f565b60008381526020839052604090205b90505b92915050565b600060c08284031215610f7a57600080fd5b50919050565b600060208284031215610f9257600080fd5b813567ffffffffffffffff811115610fa957600080fd5b6104e984828501610f68565b600060208284031215610fc757600080fd5b5035919050565b6001600160a01b0381168114610dcc57600080fd5b60008060408385031215610ff657600080fd5b823561100181610fce565b946020939093013593505050565b60006020828403121561102157600080fd5b813561042181610fce565b6000806040838503121561103f57600080fd5b823567ffffffffffffffff81111561105657600080fd5b61106285828601610f68565b95602094909401359450505050565b63ffffffff81168114610dcc57600080fd5b60ff81168114610dcc57600080fd5b803561109d81611083565b919050565b6000806000806000608086880312156110ba57600080fd5b85356110c581611071565b945060208601356110d581611071565b9350604086013567ffffffffffffffff808211156110f257600080fd5b818801915088601f83011261110657600080fd5b81358181111561111557600080fd5b89602082850101111561112757600080fd5b602083019550809450505050606086013561114181611083565b809150509295509295909350565b60008083601f84011261116157600080fd5b50813567ffffffffffffffff81111561117957600080fd5b6020830191508360208260051b850101111561119457600080fd5b9250929050565b60008060008084860360c08112156111b257600080fd5b60808112156111c057600080fd5b50849350608085013567ffffffffffffffff8111156111de57600080fd5b6111ea8782880161114f565b9598909750949560a00135949350505050565b6000806040838503121561121057600080fd5b50508035926020909101359150565b6000806000806060858703121561123557600080fd5b843567ffffffffffffffff8082111561124d57600080fd5b61125988838901610f68565b9550602087013591508082111561126f57600080fd5b5061127c8782880161114f565b9598909750949560400135949350505050565b67ffffffffffffffff81168114610dcc57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600082356112df81610fce565b6001600160a01b03811660208401525060208301356112fd8161128f565b67ffffffffffffffff80821660408501526040850135915061131e82611071565b63ffffffff80831660608601526060860135925061133b83611071565b80831660808601525060808501359150601e1985360301821261135d57600080fd5b602091850191820191358181111561137457600080fd5b80360383131561138357600080fd5b60c060a086015261139860e0860182856112a5565b925050506113a860a08501611092565b60ff811660c0850152509392505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610f6257610f626113b9565b6000602082840312156113f457600080fd5b813561042181611071565b60008135610f6281611071565b6000808335601e1984360301811261142357600080fd5b83018035915067ffffffffffffffff82111561143e57600080fd5b60200191503681900382131561119457600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061147d57607f821691505b602082108103610f7a57634e487b7160e01b600052602260045260246000fd5b601f82111561089457600081815260208120601f850160051c810160208610156114c45750805b601f850160051c820191505b818110156107e1578281556001016114d0565b67ffffffffffffffff8311156114fb576114fb611453565b61150f836115098354611469565b8361149d565b6000601f841160018114611543576000851561152b5750838201355b600019600387901b1c1916600186901b178355610af5565b600083815260209020601f19861690835b828110156115745786850135825560209485019460019092019101611554565b50868210156115915760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008135610f6281611083565b81356115bb81610fce565b6001600160a01b038116905081548173ffffffffffffffffffffffffffffffffffffffff19821617835560208401356115f38161128f565b7bffffffffffffffff00000000000000000000000000000000000000008160a01b1690507fffffffff000000000000000000000000000000000000000000000000000000008184828516171785556040860135925061165183611071565b921760e09190911b90911617815561168961166e606084016113ff565b6001830163ffffffff821663ffffffff198254161781555050565b611696608083018361140c565b6116a48183600286016114e3565b505061067f6116b560a084016115a3565b6003830160ff821660ff198254161781555050565b67ffffffffffffffff87168152600063ffffffff808816602084015280871660408401525060a0606083015261170460a0830185876112a5565b905060ff83166080830152979650505050505050565b60808101823561172981610fce565b6001600160a01b03908116835260208401359061174582610fce565b1660208301526040838101359083015260608301356117638161128f565b67ffffffffffffffff811660608401525092915050565b67ffffffffffffffff81811683821601908082111561179b5761179b6113b9565b5092915050565b634e487b7160e01b600052603260045260246000fd5b6000600182016117ca576117ca6113b9565b506001019056fea2646970667358221220a449a197632e1117b118ced8f7cf97a1ae44b160775ee146e59b50cbc1b8dcaa64736f6c63430008140033a2646970667358221220bf4e58f16d6eaf2970a5e166bc1c0e0daab80dff182f3b51307c2437f3f96b7564736f6c63430008140033", } // ManagementContractABI is the input ABI used to generate the binding from. diff --git a/contracts/src/bridge/L2/EthereumBridge.sol b/contracts/src/bridge/L2/EthereumBridge.sol index 7efce8b51e..031abbe857 100644 --- a/contracts/src/bridge/L2/EthereumBridge.sol +++ b/contracts/src/bridge/L2/EthereumBridge.sol @@ -58,7 +58,6 @@ contract EthereumBridge is function sendNative(address receiver) external payable { require(msg.value > 0, "Nothing sent."); - require(hasTokenMapping(address(0x0)), "No mapping for token."); bytes memory data = abi.encodeWithSelector( IBridge.receiveAssets.selector, @@ -67,6 +66,7 @@ contract EthereumBridge is receiver ); queueMessage(remoteBridgeAddress, data, uint32(Topics.TRANSFER), 0, 0); + _messageBus().sendValueToL2{value: msg.value}(receiver, msg.value); } function sendERC20( diff --git a/contracts/src/management/ManagementContract.sol b/contracts/src/management/ManagementContract.sol index f31a658b7e..3226a4d80c 100644 --- a/contracts/src/management/ManagementContract.sol +++ b/contracts/src/management/ManagementContract.sol @@ -144,7 +144,6 @@ contract ManagementContract is Initializable, OwnableUpgradeable { isWithdrawalSpent[keccak256(abi.encode(_msg))] = true; messageBus.receiveValueFromL2(_msg.receiver, _msg.amount); - //todo track state } // An attested enclave will pickup the Network Secret Request diff --git a/go/common/headers.go b/go/common/headers.go index 2d1325db0a..8c06b9c05e 100644 --- a/go/common/headers.go +++ b/go/common/headers.go @@ -68,8 +68,8 @@ type batchHeaderEncoding struct { CrossChainMessages []MessageBus.StructsCrossChainMessage `json:"crossChainMessages"` LatestInboundCrossChainHash common.Hash `json:"inboundCrossChainHash"` // The block hash of the latest block that has been scanned for cross chain messages. LatestInboundCrossChainHeight *hexutil.Big `json:"inboundCrossChainHeight"` // The block height of the latest block that has been scanned for cross chain messages. - TransfersTree common.Hash - CrossChainTree SerializedCrossChainTree `json:"crossChainTree"` + CrossChainRootHash common.Hash `json:"crossChainTreeHash"` + CrossChainTree SerializedCrossChainTree `json:"crossChainTree"` } // MarshalJSON custom marshals the BatchHeader into a json @@ -122,7 +122,7 @@ func (b *BatchHeader) UnmarshalJSON(data []byte) error { b.CrossChainMessages = dec.CrossChainMessages b.LatestInboundCrossChainHash = dec.LatestInboundCrossChainHash b.LatestInboundCrossChainHeight = (*big.Int)(dec.LatestInboundCrossChainHeight) - b.CrossChainRoot = dec.TransfersTree + b.CrossChainRoot = dec.CrossChainRootHash b.CrossChainTree = dec.CrossChainTree return nil } diff --git a/go/enclave/crosschain/common.go b/go/enclave/crosschain/common.go index 1d64083dbb..c3dd6aa101 100644 --- a/go/enclave/crosschain/common.go +++ b/go/enclave/crosschain/common.go @@ -258,7 +258,7 @@ func (vt ValueTransfers) ForMerkleTree() [][]interface{} { for idx := range vt { hashedVal := vt.HashPacked(idx) val := []interface{}{ - "v", + "v", // [v, "0xblabla"] hashedVal, } values = append(values, val) diff --git a/go/enclave/rpc_server.go b/go/enclave/rpc_server.go index df24e5066a..6b5cf31a28 100644 --- a/go/enclave/rpc_server.go +++ b/go/enclave/rpc_server.go @@ -35,8 +35,10 @@ type RPCServer struct { // NewEnclaveRPCServer prepares an enclave RPCServer (doesn't start listening until `StartServer` is called func NewEnclaveRPCServer(listenAddress string, enclave common.Enclave, logger gethlog.Logger) *RPCServer { return &RPCServer{ - enclave: enclave, - grpcServer: grpc.NewServer(), + enclave: enclave, + grpcServer: grpc.NewServer( + grpc.MaxRecvMsgSize(1024 * 1024 * 50), + ), logger: logger, listenAddress: listenAddress, } diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 2c6d6a6a36..9fcf7852f9 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -634,7 +634,11 @@ func (g *Guardian) periodicBundleSubmission() { bundleSubmissionTicker := time.NewTicker(interval) - fromSequenceNumber := uint64(0) + fromSequenceNumber, _, err := g.sl.L1Publisher().GetBundleRangeFromManagementContract() + if err != nil { + g.logger.Error(`Unable to get bundle range from management contract and initialize cross chain publishing`, log.ErrKey, err) + return + } for { select { @@ -645,21 +649,25 @@ func (g *Guardian) periodicBundleSubmission() { continue } - if from.Uint64() > fromSequenceNumber { - fromSequenceNumber = from.Uint64() + if from.Uint64() > fromSequenceNumber.Uint64() { + fromSequenceNumber.Set(from) } - bundle, err := g.enclaveClient.ExportCrossChainData(context.Background(), fromSequenceNumber, to.Uint64()) + bundle, err := g.enclaveClient.ExportCrossChainData(context.Background(), fromSequenceNumber.Uint64(), to.Uint64()) if err != nil { if !errors.Is(err, errutil.ErrCrossChainBundleNoBatches) { g.logger.Error("Unable to export cross chain bundle from enclave", log.ErrKey, err) } + if errors.Is(err, context.DeadlineExceeded) { + g.logger.Error(`Cross chain bundle export timed out.`, log.ErrKey, err) + return // stop the process - if we are timing out we are not going to catch up + } continue } if len(bundle.CrossChainRootHashes) == 0 { g.logger.Debug("No cross chain data to submit") - fromSequenceNumber = to.Uint64() + 1 + fromSequenceNumber.SetUint64(to.Uint64() + 1) continue } diff --git a/go/host/rpc/enclaverpc/enclave_client.go b/go/host/rpc/enclaverpc/enclave_client.go index 76ca2d05fe..583434d4d3 100644 --- a/go/host/rpc/enclaverpc/enclave_client.go +++ b/go/host/rpc/enclaverpc/enclave_client.go @@ -516,7 +516,7 @@ func (c *Client) StreamL2Updates() (chan common.StreamL2UpdatesResponse, func()) batchChan := make(chan common.StreamL2UpdatesResponse, 10) cancelCtx, cancel := context.WithCancel(context.Background()) - stream, err := c.protoClient.StreamL2Updates(cancelCtx, &generated.StreamL2UpdatesRequest{}) + stream, err := c.protoClient.StreamL2Updates(cancelCtx, &generated.StreamL2UpdatesRequest{}, grpc.MaxCallRecvMsgSize(1024*1024*50)) if err != nil { c.logger.Error("Error opening batch stream.", log.ErrKey, err) cancel() diff --git a/integration/networktest/env/network_setup.go b/integration/networktest/env/network_setup.go index 06ae70ab75..bd107052da 100644 --- a/integration/networktest/env/network_setup.go +++ b/integration/networktest/env/network_setup.go @@ -114,15 +114,14 @@ func (t *testnetEnv) startTenGateway() { TenChainID: integration.TenChainID, } tenGWContainer := walletextension.NewContainerFromConfig(cfg, t.logger) - go func() { - fmt.Println("Starting Ten Gateway, HTTP Port:", _gwHTTPPort, "WS Port:", _gwWSPort) - err := tenGWContainer.Start() - if err != nil { - t.logger.Error("failed to start ten gateway", "err", err) - panic(err) - } - t.tenGatewayContainer = tenGWContainer - }() + + fmt.Println("Starting Ten Gateway, HTTP Port:", _gwHTTPPort, "WS Port:", _gwWSPort) + err := tenGWContainer.Start() + if err != nil { + t.logger.Error("failed to start ten gateway", "err", err) + panic(err) + } + t.tenGatewayContainer = tenGWContainer t.testnetConnector.tenGatewayURL = fmt.Sprintf("http://localhost:%d", _gwHTTPPort) } diff --git a/integration/networktest/tests/helpful/accs_and_contracts_test.go b/integration/networktest/tests/helpful/accs_and_contracts_test.go index 9b6673bfe9..e96271ee05 100644 --- a/integration/networktest/tests/helpful/accs_and_contracts_test.go +++ b/integration/networktest/tests/helpful/accs_and_contracts_test.go @@ -1,23 +1,113 @@ package helpful import ( + "context" + "fmt" + "math/big" "testing" + "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/ten-protocol/go-ten/go/common/retry" + "github.com/ten-protocol/go-ten/go/wallet" + "github.com/ten-protocol/go-ten/integration/common/testlog" "github.com/ten-protocol/go-ten/integration/networktest" "github.com/ten-protocol/go-ten/integration/networktest/actions" "github.com/ten-protocol/go-ten/integration/networktest/env" ) -var _accountToFund = common.HexToAddress("0xD19f62b5A721747A04b969C90062CBb85D4aAaA8") +/* + * This file contains helpful tests for funding accounts, transferring funds, interacting with contracts, etc. + */ -// Run this test to fund an account with native funds +// Run this test to fund an account with native L2 funds func TestSendFaucetFunds(t *testing.T) { + // Set the account to fund here + accountToFund := common.HexToAddress("") + networktest.TestOnlyRunsInIDE(t) networktest.Run( "send-faucet-funds", t, env.LongRunningLocalNetwork(""), - &actions.AllocateFaucetFunds{Account: &_accountToFund}, + &actions.AllocateFaucetFunds{Account: &accountToFund}, + ) +} + +// Run this test to send native L1 ETH from one account to another +func TestTransferL1Funds(t *testing.T) { + // Set the accounts addresses and amount to send here + fromPK := "" + to := common.HexToAddress("") + // amount to send in wei + amt := big.NewInt(0).Mul(big.NewInt(1), big.NewInt(int64(params.Ether))) + + networktest.TestOnlyRunsInIDE(t) + networktest.Run( + "send-native-funds", + t, + env.SepoliaTestnet(), + actions.RunOnlyAction(func(ctx context.Context, network networktest.NetworkConnector) (context.Context, error) { + l1Wallet := wallet.NewInMemoryWalletFromConfig(fromPK, _sepoliaChainID, testlog.Logger()) + cli, err := network.GetL1Client() + if err != nil { + panic(err) + } + // in sepolia if you have issues, you may need a more reliable RPC endpoint, e.g. infura with an api-key: + // cli, err := ethadapter.NewEthClientFromURL("https://sepolia.infura.io/v3/", 10*time.Second, common.HexToAddress("0x0"), testlog.Logger()) + nonce, err := cli.Nonce(l1Wallet.Address()) + if err != nil { + panic(err) + } + l1Wallet.SetNonce(nonce) + + gasPrice, err := cli.EthClient().SuggestGasPrice(context.Background()) + if err != nil { + panic(err) + } + // apply multiplier to the gas price here if you want to guarantee it goes through quickly + // gasPrice = big.NewInt(0).Mul(gasPrice, big.NewInt(2)) + + // create transaction from l1Wallet to toAddress + tx := &types.LegacyTx{ + Nonce: l1Wallet.GetNonce(), + Value: amt, + Gas: uint64(25_000), + GasPrice: gasPrice, + To: &to, + } + signedTx, err := l1Wallet.SignTransaction(tx) + if err != nil { + panic(err) + } + + err = cli.SendTransaction(signedTx) + if err != nil { + panic(err) + } + + // await receipt + err = retry.Do(func() error { + receipt, err := cli.TransactionReceipt(signedTx.Hash()) + if err != nil { + return err + } + if receipt == nil { + return fmt.Errorf("no receipt yet") + } + if receipt.Status != types.ReceiptStatusSuccessful { + return retry.FailFast(fmt.Errorf("receipt had status failed for transaction %s", signedTx.Hash().Hex())) + } + return nil + }, retry.NewTimeoutStrategy(70*time.Second, 20*time.Second)) + + if err != nil { + panic(err) + } + + return ctx, nil + }), ) } diff --git a/integration/simulation/transaction_injector.go b/integration/simulation/transaction_injector.go index 511572c0b9..0b1a3ce907 100644 --- a/integration/simulation/transaction_injector.go +++ b/integration/simulation/transaction_injector.go @@ -344,7 +344,7 @@ func (ti *TransactionInjector) awaitAndFinalizeWithdrawal(tx *types.Transaction, return } - xchainTree := make([][]interface{}, 0) + xchainTree := make([][]interface{}, 0) // ["v", "0xblablablabla"] err = json.Unmarshal(header.CrossChainTree, &xchainTree) if err != nil { ti.logger.Error("Failed to unmarshal cross chain tree for withdrawal transaction", log.ErrKey, err)