├── .gitignore ├── .gitmodules ├── README.md ├── lido-deploy.md └── payments ├── .gitignore ├── .secret ├── chain.sh ├── contract-abi.go ├── contract-bins.go ├── contracts ├── IERC20.sol ├── LidoMevDistributor.sol ├── LightPrism.sol └── Migrations.sol ├── curlcheck.sh ├── deployed-addrs.json ├── go.mod ├── go.sum ├── main.go ├── migrations └── 1_migration.js ├── mine.sh ├── package-lock.json ├── package.json ├── test ├── .gitkeep └── test.js ├── truffle-config.js └── watch_for_arb /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "rayonism-mev-hackathon"] 2 | path = rayonism-mev-hackathon 3 | url = https://github.com/lidofinance/rayonism-mev-hackathon.git 4 | [submodule "nethermind"] 5 | path = nethermind 6 | url = https://github.com/NethermindEth/nethermind.git 7 | [submodule "mergenet-tutorial"] 8 | path = mergenet-tutorial 9 | url = https://github.com/protolambda/mergenet-tutorial.git 10 | branch = master 11 | [submodule "ray-tracing-bundles"] 12 | path = ray-tracing-bundles 13 | url = https://github.com/NethermindEth/ray-tracing-bundles.git 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ray Tracing 2 | Eth2-MEV project with liquid staking (Flashbots-Lido-Nethermind). 3 | [Notes](https://hackmd.io/riaJ_3SmQmOrXFv6rZewuQ?view) | [Slides](https://docs.google.com/presentation/d/1ouWmima9XZLJhCqO0dmfzuThprDjZpdiDcbMv_95Nhk/edit?usp=sharing) 4 | 5 | What you need to setup: 6 | 7 | * Eth2 validator with Rayonism enabled 8 | * Nethermind Eth1 node with Rayonism and MEV plugins enabled 9 | * A bundle producer that can connect to an Eth1 node and send MEV-bundles 10 | * Set of contracts deployed with Lido MEV distributor contract and Flashbots proxy LightPrism (payments splitter for MEV bundles) 11 | 12 | ![image](https://user-images.githubusercontent.com/498913/117579537-39e45300-b0eb-11eb-9f66-7fb98e7a923d.png) 13 | 14 | Team: 15 | * Lukasz (Nethermind) - MEV Plugin, The Merge Plugin 16 | * Edgar (flashbots) - arb spotter demo, contract deployments, MevMasterPayer contract 17 | * Artem (Lido) - infra, Lido flow 18 | * Jackie (Nethermind) - full flow design and discussion 19 | * Tomasz (Nethermind) - LightPrism contract, recording / demo 20 | 21 | Aknowledgement: 22 | Thanks to everyone at Flashbots, Lido and Nethermind team, and the Rayonism project. In particular, we are grateful for the support from Victor and Sam from Lido team providing insights on Lido contract value distribution, Marek and Mateusz from Nethermind for their participation in the Merge launch, Tina from Flashbots in fluid cross-team coordination bridging Rayonism and ETHGlobal hackathon, and the work of Flashbots Research on ETH2. 23 | -------------------------------------------------------------------------------- /lido-deploy.md: -------------------------------------------------------------------------------- 1 | # Deploying Lido 2 | 3 | This document describes how to deploy the Lido protocol mock and MEV rewards distributor contract. All commands are to be run inside the `rayonism-mev-hackathon` directory (a Git submodule of this repo). 4 | 5 | #### 1. Install the `eth-brownie` Python package 6 | 7 | See: https://eth-brownie.readthedocs.io/en/stable/install.html 8 | 9 | #### 2. Add Brownie network and local accounts 10 | 11 | In a posix-compatible shell, e.g. Bash: 12 | 13 | ```text 14 | $ brownie networks add Ethereum merge-hackathon host='http://138.68.75.41:8545' chainid=700 15 | 16 | $ brownie accounts new merge-hackathon-deployer 17 | 18 | 19 | $ brownie accounts new merge-hackathon-lido-treasury 20 | 21 | 22 | $ brownie accounts new merge-hackathon-op-1 23 | 24 | 25 | $ brownie accounts new merge-hackathon-op-2 26 | 27 | 28 | $ brownie accounts new merge-hackathon-op-3 29 | 30 | 31 | $ brownie accounts new merge-hackathon-st-1 32 | 33 | 34 | $ brownie accounts new merge-hackathon-st-2 35 | 36 | 37 | $ brownie accounts new merge-hackathon-st-3 38 | 39 | 40 | $ brownie console --network merge-hackathon 41 | ``` 42 | 43 | The last command will start a python Brownie console, all of the next steps will be in this console. 44 | 45 | #### 3. Load the accounts 46 | 47 | ```py 48 | >>> deployer = accounts.load('merge-hackathon-deployer') 49 | >>> treasury = accounts.load('merge-hackathon-lido-treasury') 50 | >>> ops = [ accounts.load(f'merge-hackathon-op-{i+1}') for i in range(3) ] 51 | >>> stakers = [ accounts.load(f'merge-hackathon-st-{i+1}') for i in range(3) ] 52 | ``` 53 | 54 | Enter passwords for unlocking the accounts (chosen in the step 2). 55 | 56 | #### 4. Populate stakers' accounts with ETH 57 | 58 | ```py 59 | >>> deployer.transfer(stakers[0], amount='100 ether') 60 | >>> deployer.transfer(stakers[1], amount='100 ether') 61 | >>> deployer.transfer(stakers[2], amount='100 ether') 62 | ``` 63 | 64 | #### 5. Deploy the Lido protocol and MEV distributor 65 | 66 | ```py 67 | >>> from scripts.deploy import deploy, add_operators, stake 68 | >>> (lido, registry, distributor) = deploy(Lido, NodeOperatorsRegistry, DepositContractMock, LidoMevDistributor, deployer, treasury) 69 | ``` 70 | 71 | #### 6. Add Lido node operators 72 | 73 | ```py 74 | >>> add_operators(registry, operators, deployer) 75 | ``` 76 | 77 | #### 7. Stake some ETH 78 | 79 | ```py 80 | >>> stake(lido, [(stakers[0], 1 * 10**18), (stakers[1], 32 * 10**18), (stakers[2], 96 * 10**18)], deployer) 81 | ``` 82 | 83 | This will also pretend that validators' beacon balance has increased due to staking rewards, so stETH balances of stakers will also increase. 84 | 85 | #### 8. Print stakers' and node operators' stETH balances 86 | 87 | ```py 88 | >>> [ lido.balanceOf(staker) / 10**18 for staker in stakers ] 89 | >>> [ lido.balanceOf(op) / 10**18 for op in ops ] 90 | ``` 91 | 92 | #### 9. Test MEV distribution 93 | 94 | To test the distribution, send some ETH to the MEV distributor contract: 95 | 96 | ```py 97 | >>> tx = distributor.distribureMev({'from': deployer, 'value': '10 ether'}) 98 | >>> tx.info() 99 | ``` 100 | 101 | Print the stETH balances once again to see them increased: 102 | 103 | ```py 104 | >>> [ lido.balanceOf(staker) / 10**18 for staker in stakers ] 105 | >>> [ lido.balanceOf(op) / 10**18 for op in ops ] 106 | ``` 107 | -------------------------------------------------------------------------------- /payments/.gitignore: -------------------------------------------------------------------------------- 1 | contracts/.placeholder 2 | test/.placeholder 3 | build 4 | node_modules 5 | #.secret 6 | .tern-port -------------------------------------------------------------------------------- /payments/.secret: -------------------------------------------------------------------------------- 1 | east close avoid salon surge cluster cross among point resource glass keep -------------------------------------------------------------------------------- /payments/chain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ganache-cli \ 4 | --mnemonic 'volume memory bachelor slow flight faith logic problem select gym lyrics rhythm' 5 | -------------------------------------------------------------------------------- /payments/contract-abi.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | const ( 4 | depositABI = `[{"constant":false,"inputs":[{"name":"pubkey","type":"bytes"},{"name":"withdrawal_credentials","type":"bytes"},{"name":"signature","type":"bytes"},{"name":"deposit_data_root","type":"bytes32"}],"name":"deposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"pubkey","type":"bytes"},{"indexed":false,"name":"withdrawal_credentials","type":"bytes"},{"indexed":false,"name":"signature","type":"bytes"},{"indexed":false,"name":"deposit_data_root","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Deposit","type":"event"}]` 5 | 6 | nodeRegistryABI = `[{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_rewardAddress","type":"address"},{"name":"_stakingLimit","type":"uint64"}],"name":"addNodeOperator","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_quantity","type":"uint256"},{"name":"_pubkeys","type":"bytes"},{"name":"_signatures","type":"bytes"}],"name":"addSigningKeys","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_numKeys","type":"uint256"}],"name":"assignNextSigningKeys","outputs":[{"name":"pubkeys","type":"bytes"},{"name":"signatures","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"SIGNATURE_LENGTH","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_name","type":"string"}],"name":"setNodeOperatorName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_totalRewardShares","type":"uint256"}],"name":"getRewardsDistribution","outputs":[{"name":"recipients","type":"address[]"},{"name":"shares","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_active","type":"bool"}],"name":"setNodeOperatorActive","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_index","type":"uint256"}],"name":"removeSigningKey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_lido","type":"address"}],"name":"setLido","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_quantity","type":"uint256"},{"name":"_pubkeys","type":"bytes"},{"name":"_signatures","type":"bytes"}],"name":"addSigningKeysOperatorBH","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getActiveNodeOperatorsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_operator_id","type":"uint256"}],"name":"getUnusedSigningKeyCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_rewardAddress","type":"address"}],"name":"setNodeOperatorRewardAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"},{"name":"_fullInfo","type":"bool"}],"name":"getNodeOperator","outputs":[{"name":"active","type":"bool"},{"name":"name","type":"string"},{"name":"rewardAddress","type":"address"},{"name":"stakingLimit","type":"uint64"},{"name":"stoppedValidators","type":"uint64"},{"name":"totalSigningKeys","type":"uint64"},{"name":"usedSigningKeys","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PUBKEY_LENGTH","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNodeOperatorsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_stakingLimit","type":"uint64"}],"name":"setNodeOperatorStakingLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_index","type":"uint256"}],"name":"getSigningKey","outputs":[{"name":"key","type":"bytes"},{"name":"depositSignature","type":"bytes"},{"name":"used","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_stoppedIncrement","type":"uint64"}],"name":"reportStoppedValidators","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_operator_id","type":"uint256"}],"name":"getTotalSigningKeyCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_operator_id","type":"uint256"},{"name":"_index","type":"uint256"}],"name":"removeSigningKeyOperatorBH","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"trimUnusedKeys","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"id","type":"uint256"},{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"rewardAddress","type":"address"},{"indexed":false,"name":"stakingLimit","type":"uint64"}],"name":"NodeOperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"active","type":"bool"}],"name":"NodeOperatorActiveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"name","type":"string"}],"name":"NodeOperatorNameSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"rewardAddress","type":"address"}],"name":"NodeOperatorRewardAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"stakingLimit","type":"uint64"}],"name":"NodeOperatorStakingLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"totalStopped","type":"uint64"}],"name":"NodeOperatorTotalStoppedValidatorsReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operatorId","type":"uint256"},{"indexed":false,"name":"pubkey","type":"bytes"}],"name":"SigningKeyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operatorId","type":"uint256"},{"indexed":false,"name":"pubkey","type":"bytes"}],"name":"SigningKeyRemoved","type":"event"}]` 7 | 8 | lidoABI = `[{"constant":false,"inputs":[],"name":"resume","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"stop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getInsuranceFund","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_ethAmount","type":"uint256"}],"name":"getSharesByPooledEth","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_sender","type":"address"},{"name":"_recipient","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOperators","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"DEPOSIT_SIZE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTotalPooledEther","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getTreasury","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isStopped","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBufferedEther","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SIGNATURE_LENGTH","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getWithdrawalCredentials","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getFeeDistribution","outputs":[{"name":"treasuryFeeBasisPoints","type":"uint16"},{"name":"insuranceFeeBasisPoints","type":"uint16"},{"name":"operatorsFeeBasisPoints","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_sharesAmount","type":"uint256"}],"name":"getPooledEthByShares","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOracle","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_treasuryFeeBasisPoints","type":"uint16"},{"name":"_insuranceFeeBasisPoints","type":"uint16"},{"name":"_operatorsFeeBasisPoints","type":"uint16"}],"name":"setFeeDistribution","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_feeBasisPoints","type":"uint16"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_maxDeposits","type":"uint256"}],"name":"depositBufferedEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_referral","type":"address"}],"name":"submit","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"WITHDRAWAL_CREDENTIALS_LENGTH","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"PUBKEY_LENGTH","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"},{"name":"_pubkeyHash","type":"bytes32"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_recipient","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getDepositContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBeaconStat","outputs":[{"name":"depositedValidators","type":"uint256"},{"name":"beaconValidators","type":"uint256"},{"name":"beaconBalance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_insuranceFund","type":"address"}],"name":"setInsuranceFund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getFee","outputs":[{"name":"feeBasisPoints","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTotalShares","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_withdrawalCredentials","type":"bytes32"}],"name":"setWithdrawalCredentials","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"depositBufferedEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_account","type":"address"},{"name":"_sharesAmount","type":"uint256"}],"name":"burnShares","outputs":[{"name":"newTotalShares","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_beaconValidators","type":"uint256"},{"name":"_beaconBalance","type":"uint256"}],"name":"pushBeacon","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_account","type":"address"}],"name":"sharesOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"depositContract","type":"address"},{"name":"_oracle","type":"address"},{"name":"_operators","type":"address"},{"name":"_treasury","type":"address"},{"name":"_insuranceFund","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[],"name":"Stopped","type":"event"},{"anonymous":false,"inputs":[],"name":"Resumed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"feeBasisPoints","type":"uint16"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"treasuryFeeBasisPoints","type":"uint16"},{"indexed":false,"name":"insuranceFeeBasisPoints","type":"uint16"},{"indexed":false,"name":"operatorsFeeBasisPoints","type":"uint16"}],"name":"FeeDistributionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"withdrawalCredentials","type":"bytes32"}],"name":"WithdrawalCredentialsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"referral","type":"address"}],"name":"Submitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Unbuffered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"tokenAmount","type":"uint256"},{"indexed":false,"name":"sentFromBuffer","type":"uint256"},{"indexed":true,"name":"pubkeyHash","type":"bytes32"},{"indexed":false,"name":"etherAmount","type":"uint256"}],"name":"Withdrawal","type":"event"}]` 9 | 10 | 11 | lidoMEVABI = `[{"inputs":[{"internalType":"address","name":"_lidoAddress","type":"address"},{"internalType":"uint256","name":"_validatorsMevShare","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LidoMevDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LidoMevReceived","type":"event"},{"inputs":[],"name":"distribureMev","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"lidoAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"validatorsMevShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]` 12 | 13 | lightPrismABI = `[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"address","name":"receivingAddress","type":"address"},{"indexed":false,"internalType":"address","name":"msgSender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FlashbotsPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"address","name":"stakingPool","type":"address"}],"name":"RecipientUpdate","type":"event"},{"stateMutability":"payable","type":"receive"},{"inputs":[{"internalType":"address","name":"executor","type":"address"},{"internalType":"address","name":"stakingPool","type":"address"}],"name":"setRecipients","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_who","type":"address"}],"name":"getRecipients","outputs":[{"components":[{"internalType":"address","name":"executor","type":"address"},{"internalType":"address","name":"stakingPool","type":"address"}],"internalType":"struct Recipients","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payMiner","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"queueEther","outputs":[],"stateMutability":"payable","type":"function"}]` 14 | ) 15 | -------------------------------------------------------------------------------- /payments/contract-bins.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | const ( 4 | depositContractByteCode = `0x608060405234801561001057600080fd5b50610150806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663228951188114610045575b600080fd5b6100736024600480358281019290820135918135808301929082013591604435918201910135606435610075565b005b7f52899a5d865569c10275b353ac2a45f6a60dd9e080588be17465ed25d52d71da878787878787873460405180806020018060200180602001866000191660001916815260200185815260200184810384528c8c8281815260200192508082843790910185810384528a815260200190508a8a808284379091018581038352888152602001905088888082843760405192018290039d50909b505050505050505050505050a1505050505050505600a165627a7a723058204bbaad611309a48a75636f696dabe347d3421416a8bf9a62bf5dd4f46d63784b0029` 5 | nodeOperatorsRegistryByteCode = `0x60806040523480156200001157600080fd5b50604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e746f74616c81527f4f70657261746f7273436f756e740000000000000000000000000000000000006020820152905190819003602e0190206200008590600064010000000062001c18620000fe82021704565b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e616374697681527f654f70657261746f7273436f756e7400000000000000000000000000000000006020820152905190819003602f019020620000f890600064010000000062001c18620000fe82021704565b62000102565b9055565b612bf980620001126000396000f3006080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166309573fd4811461012c578063096b7b351461017957806341bc716f146101af578063540bc5ea146102a55780635e57d742146102ba57806362dcfda1146102de578063687ca3371461038f5780636ef355f1146103ac5780637d774e31146103c7578063805911ae146103e85780638469cbd31461041c5780638ca7c05214610431578063973e9328146104495780639a56983c1461046d578063a4d55d1d14610549578063a70c70e41461055e578063ae962acf14610573578063b449402a14610598578063be726da21461069c578063db9887ea146106c1578063ed5cfa41146106d9578063f778021e146106f4575b600080fd5b34801561013857600080fd5b506101676024600480358281019291013590600160a060020a0390351667ffffffffffffffff60443516610709565b60408051918252519081900360200190f35b34801561018557600080fd5b506101ad60048035906024803591604435808301929082013591606435918201910135610966565b005b3480156101bb57600080fd5b506101c76004356109d7565b604051808060200180602001838103835285818151815260200191508051906020019080838360005b838110156102085781810151838201526020016101f0565b50505050905090810190601f1680156102355780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015610268578181015183820152602001610250565b50505050905090810190601f1680156102955780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b3480156102b157600080fd5b50610167610d38565b3480156102c657600080fd5b506101ad600480359060248035908101910135610d3d565b3480156102ea57600080fd5b506102f6600435610dfe565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561033a578181015183820152602001610322565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610379578181015183820152602001610361565b5050505090500194505050505060405180910390f35b34801561039b57600080fd5b506101ad6004356024351515610fe3565b3480156103b857600080fd5b506101ad6004356024356110e2565b3480156103d357600080fd5b506101ad600160a060020a03600435166110f0565b3480156103f457600080fd5b506101ad60048035906024803591604435808301929082013591606435918201910135611135565b34801561042857600080fd5b50610167611196565b34801561043d57600080fd5b50610167600435611200565b34801561045557600080fd5b506101ad600435600160a060020a0360243516611296565b34801561047957600080fd5b5061048a60043560243515156113bd565b604080518815158152600160a060020a0387169181019190915267ffffffffffffffff8086166060830152848116608083015283811660a0830152821660c082015260e0602080830182815289519284019290925288516101008401918a019080838360005b838110156105085781810151838201526020016104f0565b50505050905090810190601f1680156105355780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b34801561055557600080fd5b5061016761152b565b34801561056a57600080fd5b50610167611530565b34801561057f57600080fd5b506101ad60043567ffffffffffffffff60243516611594565b3480156105a457600080fd5b506105b3600435602435611649565b60405180806020018060200184151515158152602001838103835286818151815260200191508051906020019080838360005b838110156105fe5781810151838201526020016105e6565b50505050905090810190601f16801561062b5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561065e578181015183820152602001610646565b50505050905090810190601f16801561068b5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156106a857600080fd5b506101ad60043567ffffffffffffffff60243516611755565b3480156106cd57600080fd5b50610167600435611940565b3480156106e557600080fd5b506101ad6004356024356119b7565b34801561070057600080fd5b506101ad611a18565b6000808084600160a060020a038116151561076e576040805160e560020a62461bcd02815260206004820152600d60248201527f454d5054595f4144445245535300000000000000000000000000000000000000604482015290519081900360640190fd5b610776611530565b93506107f061078c85600163ffffffff611b4216565b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e746f74616c81527f4f70657261746f7273436f756e740000000000000000000000000000000000006020820152905190819003602e0190209063ffffffff611c1816565b60008481526020819052604090209250610808611196565b915061088261081e83600163ffffffff611b4216565b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e616374697681527f654f70657261746f7273436f756e7400000000000000000000000000000000006020820152905190819003602f0190209063ffffffff611c1816565b825460ff19166001908117845561089c9084018989612ac2565b50825474ffffffffffffffffffffffffffffffffffffffff001916610100600160a060020a03881690810291909117845560028401805467ffffffffffffffff191667ffffffffffffffff8816908117909155604080518781529081019290925260608201526080602082018181529082018990527fc52ec0ad7872dae440d886040390c13677df7bf3cca136d8d81e5e5e7dd62ff19186918b918b918b918b9160a0820186868082843760405192018290039850909650505050505050a1505050949350505050565b6109cf868686868080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f8c018190048102820181019092528a815294508a9350899250829150840183828082843750611c1c945050505050565b505050505050565b606080606060006109e6612b3c565b6000806000806000806000606080610a3660405180807f6c69646f2e4e6f64654f70657261746f727352656769737472792e6c69646f00815250601f019050604051809103902060001916611f83565b600160a060020a03163314610a83576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020612b8e833981519152604482015290519081900360640190fd5b610a8b611f87565b9b508b5160001415610ac35760408051600080825260208201909252905b50604080516000815260208101909152909e509c50610d27565b60009a505b8e8b1015610bcf578b519850600096505b8b51871015610b79578b87815181101515610af057fe5b90602001906020020151995089606001518a6080015111151515610b1057fe5b89606001518a608001511415610b2557610b6e565b60408a015160808b0151610b3e9163ffffffff61210216565b95508960200151866001011115610b5457610b6e565b8b51891480610b6257508786105b15610b6e578698508597505b866001019650610ad9565b8b51891415610b8757610bcf565b8b89815181101515610b9557fe5b602090810290910101516080810151909a5067ffffffffffffffff11610bb757fe5b60808a01805160019081019091529a909a0199610ac8565b8a1515610bec576040805160008082526020820190925290610aa9565b60018b1115610c1257610c0160308c02612196565b9d50610c0f60608c02612196565b9c505b60009450600093505b8b51841015610d1e578b84815181101515610c3257fe5b9060200190602002015199508960a001518a608001511415610c5357610d13565b60808a01518a516000908152602081905260409020600201805467ffffffffffffffff90921660c060020a0277ffffffffffffffffffffffffffffffffffffffffffffffff90921691909117905560a08a015192505b8960800151831015610d06578951610cc190846121a8565b915091508a60011415610cd95781819d509d50610d27565b610ce7828f60308802612252565b610cf5818e60608802612252565b846001019450826001019250610ca9565b8a851415610d1357610d1e565b836001019350610c1b565b848b14610d2757fe5b505050505050505050505050915091565b606081565b82610d46611530565b8110610d8a576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b6000848152602081905260409020610da6906001018484612ac2565b50837fcb16868f4831cc58a28d413f658752a2958bd1f50e94ed6391716b936c48093b84846040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a250505050565b606080600080600080600080600080610e15611530565b9750610e1f611196565b965086604051908082528060200260200182016040528015610e4b578160200160208202803883390190505b50995086604051908082528060200260200182016040528015610e78578160200160208202803883390190505b5098506000955060009450600093505b87841015610f60576000848152602081905260409020805490935060ff161515610eb157610f55565b6002830154610edf9067ffffffffffffffff60c060020a8204811691680100000000000000009004166122d4565b67ffffffffffffffff169150610efb858363ffffffff611b4216565b83548b519196506101009004600160a060020a0316908b9088908110610f1d57fe5b600160a060020a03909216602092830290910190910152885182908a9088908110610f4457fe5b602090810290910101526001909501945b836001019350610e88565b841515610f6c57610fd6565b610f7c8b8663ffffffff61236d16565b9050600095505b86861015610fd657610fb3818a88815181101515610f9d57fe5b602090810290910101519063ffffffff61240d16565b8987815181101515610fc157fe5b60209081029091010152600190950194610f83565b5050505050505050915091565b600082610fee611530565b8110611032576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b60008481526020819052604090205460ff1615158315151461108b57611056611196565b915082156110775761107261081e83600163ffffffff611b4216565b61108b565b61108b61081e83600163ffffffff61210216565b60008481526020818152604091829020805460ff19168615159081179091558251908152915186927fecdf08e8a6c4493efb460f6abc7d14532074fa339c3a6410623a1d3ee0fb2cac92908290030190a250505050565b6110ec82826124b8565b5050565b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e6c69646f008152905190819003601f019020611132908263ffffffff611c1816565b50565b6000868152602081905260409020546101009004600160a060020a03163314610966576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020612b8e833981519152604482015290519081900360640190fd5b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e616374697681527f654f70657261746f7273436f756e7400000000000000000000000000000000006020820152905190819003602f0190206000906111fa90611f83565b90505b90565b60008161120b611530565b811061124f576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b6000838152602081905260409020600201546112859067ffffffffffffffff608060020a820481169160c060020a9004166122d4565b67ffffffffffffffff169392505050565b8161129f611530565b81106112e3576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b81600160a060020a0381161515611344576040805160e560020a62461bcd02815260206004820152600d60248201527f454d5054595f4144445245535300000000000000000000000000000000000000604482015290519081900360640190fd5b60008481526020818152604091829020805474ffffffffffffffffffffffffffffffffffffffff001916610100600160a060020a038816908102919091179091558251908152915186927f9a52205165d510fc1e428886d52108725dc01ed544da1702dc7bd3fdb3f243b292908290030190a250505050565b60006060600080600080600080896113d3611530565b8110611417576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b60008b8152602081905260409020805460ff169950915089611447576040805160208101909152600081526114d4565b60018281018054604080516020600295841615610100026000190190931694909404601f8101839004830285018301909152808452908301828280156114ce5780601f106114a3576101008083540402835291602001916114ce565b820191906000526020600020905b8154815290600101906020018083116114b157829003601f168201915b50505050505b8254600290930154999c909b50610100909204600160a060020a031699505067ffffffffffffffff8089169868010000000000000000810482169850608060020a81048216975060c060020a900416945092505050565b603081565b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e746f74616c81527f4f70657261746f7273436f756e740000000000000000000000000000000000006020820152905190819003602e0190206000906111fa90611f83565b8161159d611530565b81106115e1576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b60008381526020818152604091829020600201805467ffffffffffffffff191667ffffffffffffffff86169081179091558251908152915185927f59d11713a8801e3ba782d59e757fbcef75ca2ecabce8ccd06a0827941230b9f292908290030190a2505050565b60608060006060808661165a611530565b811061169e576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b600088815260208190526040902060020154608060020a900467ffffffffffffffff168710611717576040805160e560020a62461bcd02815260206004820152600d60248201527f4b45595f4e4f545f464f554e4400000000000000000000000000000000000000604482015290519081900360640190fd5b61172188886121a8565b6000998a5260208a9052604090992060020154909960c060020a90910467ffffffffffffffff169097109695505050505050565b8161175e611530565b81106117a2576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b67ffffffffffffffff82161515611803576040805160e560020a62461bcd02815260206004820152600b60248201527f454d5054595f56414c5545000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000838152602081905260409020600201546118359068010000000000000000900467ffffffffffffffff168361277f565b600084815260208190526040902060020180546fffffffffffffffff000000000000000019166801000000000000000067ffffffffffffffff9384168102919091179182905560c060020a82048316910490911611156118df576040805160e560020a62461bcd02815260206004820152601a60248201527f53544f505045445f4d4f52455f5448414e5f4c41554e43484544000000000000604482015290519081900360640190fd5b600083815260208181526040918290206002015482516801000000000000000090910467ffffffffffffffff168152915185927fe6452c223b953d8ab5cb26c014095615322891268537911ba6fe1c939689703d92908290030190a2505050565b60008161194b611530565b811061198f576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b5050600090815260208190526040902060020154608060020a900467ffffffffffffffff1690565b6000828152602081905260409020546101009004600160a060020a031633146110e2576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020612b8e833981519152604482015290519081900360640190fd5b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e6c69646f008152905190819003601f0190206000908190611a5890611f83565b600160a060020a03163314611aa5576040805160e560020a62461bcd02815260206004820152600f6024820152600080516020612b8e833981519152604482015290519081900360640190fd5b611aad611530565b9150600090505b818110156110ec57600081815260208190526040902060020154608060020a810467ffffffffffffffff90811660c060020a9092041614611b3a5760008181526020819052604090206002018054608060020a67ffffffffffffffff60c060020a8304160277ffffffffffffffff00000000000000000000000000000000199091161790555b600101611ab4565b60408051808201909152601181527f4d4154485f4144445f4f564552464c4f5700000000000000000000000000000060208201526000908383019084821015611c0c5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611bd1578181015183820152602001611bb9565b50505050905090810190601f168015611bfe5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b508091505b5092915050565b9055565b600060608086611c2a611530565b8110611c6e576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b861515611cc5576040805160e560020a62461bcd02815260206004820152600760248201527f4e4f5f4b45595300000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611cd687603063ffffffff61240d16565b865114611d2d576040805160e560020a62461bcd02815260206004820152600e60248201527f494e56414c49445f4c454e475448000000000000000000000000000000000000604482015290519081900360640190fd5b611d3e87606063ffffffff61240d16565b855114611d95576040805160e560020a62461bcd02815260206004820152600e60248201527f494e56414c49445f4c454e475448000000000000000000000000000000000000604482015290519081900360640190fd5b600093505b86841015611efa57611db18660308602603061281a565b9250611dbc8361289b565b15611e11576040805160e560020a62461bcd02815260206004820152600960248201527f454d5054595f4b45590000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611e208560608602606061281a565b600089815260208190526040902060020154909250611e55908990608060020a900467ffffffffffffffff16860185856128d3565b877fc77a17d6b857abe6d6e6c37301621bc72c4dd52fa8830fb54dfa715c04911a89846040518080602001828103825283818151815260200191508051906020019080838360005b83811015611eb5578181015183820152602001611e9d565b50505050905090810190601f168015611ee25780820380516001836020036101000a031916815260200191505b509250505060405180910390a2836001019350611d9a565b611f2f611f0688612948565b60008a815260208190526040902060020154608060020a900467ffffffffffffffff169061277f565b600098895260208990526040909820600201805467ffffffffffffffff99909916608060020a0277ffffffffffffffff00000000000000000000000000000000199099169890981790975550505050505050565b5490565b6060600080600080611f97612b3c565b611f9f611196565b604051908082528060200260200182016040528015611fd857816020015b611fc5612b3c565b815260200190600190039081611fbd5790505b509550855160001415611fea576120fa565b611ff2611530565b945060009350600092505b848310156120a2576000838152602081905260409020805490925060ff16151561202657612097565b855160018501948791811061203757fe5b6020908102909101810151848152600284015467ffffffffffffffff8082169383019390935268010000000000000000810483166040830152608060020a81048316606083015260c060020a90049091166080820181905260a082015290505b826001019250611ffd565b855184146120fa576040805160e560020a62461bcd02815260206004820152601860248201527f494e434f53495354454e545f4143544956455f434f554e540000000000000000604482015290519081900360640190fd5b505050505090565b60408051808201909152601281527f4d4154485f5355425f554e444552464c4f570000000000000000000000000000602082015260009081908484111561218e5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611bd1578181015183820152602001611bb9565b505050900390565b60408051828152918201602001905290565b606080600081816121b98787612960565b604080518181526060810182529194506020820161080080388339505084546020830152506001840154604082015260029093019291506121fd826000603061281a565b6040805160608082526080820190925291965060208201610c0080388339019050509350600090505b6060811015612248578254602082860181019190915260019093019201612226565b5050509250929050565b600080835185518401111515156122b3576040805160e560020a62461bcd02815260206004820152601960248201527f42595445535f41525241595f4f55545f4f465f424f554e445300000000000000604482015290519081900360640190fd5b60208501915082602085010190506122cd82828751612a43565b5050505050565b60408051808201909152601481527f4d41544836345f5355425f554e444552464c4f570000000000000000000000006020820152600090819067ffffffffffffffff808616908516111561218e5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611bd1578181015183820152602001611bb9565b60408051808201909152600d81527f4d4154485f4449565f5a45524f00000000000000000000000000000000000000602082015260009081908184116123f85760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611bd1578181015183820152602001611bb9565b50828481151561240457fe5b04949350505050565b6000808315156124205760009150611c11565b5082820282848281151561243057fe5b60408051808201909152601181527f4d4154485f4d554c5f4f564552464c4f5700000000000000000000000000000060208201529291900414611c0c5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611bd1578181015183820152602001611bb9565b60606000606080856124c8611530565b811061250c576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612bae833981519152604482015290519081900360640190fd5b600087815260208190526040902060020154608060020a900467ffffffffffffffff168610612585576040805160e560020a62461bcd02815260206004820152600d60248201527f4b45595f4e4f545f464f554e4400000000000000000000000000000000000000604482015290519081900360640190fd5b60008781526020819052604090206002015460c060020a900467ffffffffffffffff168610156125ff576040805160e560020a62461bcd02815260206004820152600c60248201527f4b45595f5741535f555345440000000000000000000000000000000000000000604482015290519081900360640190fd5b61260987876121a8565b5060008881526020819052604090206002015490955061263b90608060020a900467ffffffffffffffff1660016122d4565b67ffffffffffffffff169350838610156126695761265987856121a8565b92509250612669878785856128d3565b6126738785612a91565b6000878152602081905260409020600201546126a190608060020a900467ffffffffffffffff1660016122d4565b60008089815260200190815260200160002060020160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550867fea4b75aaf57196f73d338cadf79ecd0a437902e2dd0d2c4c2cf3ea71b8ab27b9866040518080602001828103825283818151815260200191508051906020019080838360005b8381101561273c578181015183820152602001612724565b50505050905090810190601f1680156127695780820380516001836020036101000a031916815260200191505b509250505060405180910390a250505050505050565b60408051808201909152601381527f4d41544836345f4144445f4f564552464c4f570000000000000000000000000060208201526000908383019067ffffffffffffffff8086169083161015611c0c5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611bd1578181015183820152602001611bb9565b60608082840185511015151561282f57600080fd5b8215801561284857604051915060208201604052612892565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612881578051835260209283019201612869565b5050858452601f01601f1916604052505b50949350505050565b6000806000603084511415156128ad57fe5b505060208201516040830151811580156128cb5750608060020a8104155b949350505050565b6000806000603085511415156128e557fe5b83516060146128f057fe5b6128fa8787612960565b602086015181556040860151608090811c811b6001830155600290910193509150600090505b606081101561293f576020818501810151845560019093019201612920565b50505050505050565b600067ffffffffffffffff82111561295c57fe5b5090565b604080517f6c69646f2e4e6f64654f70657261746f727352656769737472792e7369676e6981527f6e674b6579734d617070696e674e616d650000000000000000000000000000006020808301919091528251918290036031018220828201528183018590526060808301859052835180840390910181526080909201928390528151600093918291908401908083835b60208310612a105780518252601f1990920191602091820191016129f1565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b5b601f811115612a64578251825260209283019290910190601f1901612a44565b6000811115612a8c5760018160200360080260011b0380198451168184511681811785525050505b505050565b600080612a9e8484612960565b9150600090505b6005811015612abc57600082820155600101612aa5565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612b035782800160ff19823516178555612b30565b82800160010185558215612b30579182015b82811115612b30578235825591602001919060010190612b15565b5061295c929150612b73565b60c0604051908101604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6111fd91905b8082111561295c5760008155600101612b7956004150505f415554485f4641494c454400000000000000000000000000000000004e4f44455f4f50455241544f525f4e4f545f464f554e44000000000000000000a165627a7a723058207ad528edef07024b21bbef4b557127752863f731d9f69d97494ac3a39fbc9d460029` 6 | lidoByteCode = `0x60806040523480156200001157600080fd5b5060405160a08062003e0783398101604090815281516020830151918301516060840151608090940151919390916200005385640100000000620000ae810204565b62000067846401000000006200017f810204565b6200007b83640100000000620001cb810204565b6200008f8264010000000062000299810204565b620000a3816401000000006200035d810204565b505050505062000454565b620000c28164010000000062000421810204565b15156200013057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415f434f4e5452414354000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e6465706f736974436f6e747261637400000000000000815290519081900360190190206200017c9082640100000000620022716200045082021704565b50565b604080517f6c69646f2e4c69646f2e6f7261636c6500000000000000000000000000000000815290519081900360100190206200017c9082640100000000620022716200045082021704565b620001df8164010000000062000421810204565b15156200024d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e4f545f415f434f4e5452414354000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e6e6f64654f70657261746f72735265676973747279008152905190819003601f0190206200017c9082640100000000620022716200045082021704565b600160a060020a03811615156200031157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f5345545f54524541535552595f5a45524f5f4144445245535300000000000000604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e74726561737572790000000000000000000000000000815290519081900360120190206200017c9082640100000000620022716200045082021704565b600160a060020a0381161515620003d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5345545f494e535552414e43455f46554e445f5a45524f5f4144445245535300604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e696e737572616e636546756e64000000000000000000815290519081900360170190206200017c9082640100000000620022716200045082021704565b600080600160a060020a03831615156200043f57600091506200044a565b823b90506000811191505b50919050565b9055565b6139a380620004646000396000f30060806040526004361061020b5763ffffffff60e060020a600035041663046f7da2811461026e57806306fdde031461028557806307da68f51461030f578063095ea7b314610324578063158626f71461035c57806318160ddd1461038d57806319208451146103b457806323b872dd146103cc57806327a099d8146103f6578063313ce5671461040b57806336bf33251461043657806337cfdaca1461038d578063395093511461044b5780633b19e84a1461046f5780633f683b6a1461048457806347b714e014610499578063540bc5ea146104ae57806356396715146104c357806370a08231146104d8578063752f77f1146104f95780637a28fb88146105345780637adbf9731461054c578063833b1fce1461056d5780638cef3612146105825780638e005553146105aa57806390adc83b146105c657806395d89b41146105de578063a1903eab146105f3578063a30448c014610607578063a457c2d71461061c578063a4d55d1d14610640578063a8d2021a14610655578063a9059cbb14610670578063ab94276a14610694578063ae2e3538146106a9578063c3c05293146106dc578063ced72f87146106fd578063d5002f2e14610729578063dd62ed3e1461073e578063e97ee8cc14610765578063ecc1dcfb1461077d578063ee7a7c0414610792578063f0f44260146107b6578063f16ac1fc146107d7578063f5eb42dc146107f2575b3615610261576040805160e560020a62461bcd02815260206004820152600e60248201527f4e4f4e5f454d5054595f44415441000000000000000000000000000000000000604482015290519081900360640190fd5b61026b6000610813565b50005b34801561027a57600080fd5b50610283610927565b005b34801561029157600080fd5b5061029a610931565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102d45781810151838201526020016102bc565b50505050905090810190601f1680156103015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561031b57600080fd5b50610283610968565b34801561033057600080fd5b50610348600160a060020a0360043516602435610970565b604080519115158252519081900360200190f35b34801561036857600080fd5b50610371610986565b60408051600160a060020a039092168252519081900360200190f35b34801561039957600080fd5b506103a26109c9565b60408051918252519081900360200190f35b3480156103c057600080fd5b506103a26004356109d3565b3480156103d857600080fd5b50610348600160a060020a0360043581169060243516604435610a21565b34801561040257600080fd5b50610371610af3565b34801561041757600080fd5b50610420610b31565b6040805160ff9092168252519081900360200190f35b34801561044257600080fd5b506103a2610b36565b34801561045757600080fd5b50610348600160a060020a0360043516602435610b43565b34801561047b57600080fd5b50610371610b7f565b34801561049057600080fd5b50610348610bbd565b3480156104a557600080fd5b506103a2610bef565b3480156104ba57600080fd5b506103a2610bf9565b3480156104cf57600080fd5b506103a2610bfe565b3480156104e457600080fd5b506103a2600160a060020a0360043516610c3c565b34801561050557600080fd5b5061050e610c55565b6040805161ffff9485168152928416602084015292168183015290519081900360600190f35b34801561054057600080fd5b506103a2600435610c6d565b34801561055857600080fd5b50610283600160a060020a0360043516610c99565b34801561057957600080fd5b50610371610ca5565b34801561058e57600080fd5b5061028361ffff60043581169060243581169060443516610ce3565b3480156105b657600080fd5b5061028361ffff60043516610e69565b3480156105d257600080fd5b50610283600435610edf565b3480156105ea57600080fd5b5061029a610ee8565b6103a2600160a060020a0360043516610f1f565b34801561061357600080fd5b506103a2610f2a565b34801561062857600080fd5b50610348600160a060020a0360043516602435610f2f565b34801561064c57600080fd5b506103a2610fcc565b34801561066157600080fd5b50610283600435602435610fd1565b34801561067c57600080fd5b50610348600160a060020a036004351660243561108e565b3480156106a057600080fd5b5061037161109b565b3480156106b557600080fd5b506106be6110d9565b60408051938452602084019290925282820152519081900360600190f35b3480156106e857600080fd5b50610283600160a060020a0360043516611168565b34801561070957600080fd5b50610712611171565b6040805161ffff9092168252519081900360200190f35b34801561073557600080fd5b506103a261117b565b34801561074a57600080fd5b506103a2600160a060020a0360043581169060243516611185565b34801561077157600080fd5b506102836004356111b0565b34801561078957600080fd5b50610283611286565b34801561079e57600080fd5b506103a2600160a060020a0360043516602435611290565b3480156107c257600080fd5b50610283600160a060020a03600435166112a3565b3480156107e357600080fd5b506102836004356024356112ac565b3480156107fe57600080fd5b506103a2600160a060020a036004351661157d565b604080516000805160206138f88339815191528152905190819003601801902060009081908190819061084590611588565b1515610889576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b3392503491508115156108e6576040805160e560020a62461bcd02815260206004820152600c60248201527f5a45524f5f4445504f5349540000000000000000000000000000000000000000604482015290519081900360640190fd5b6108ef826109d3565b90508015156108fb5750805b610905838261158c565b506109118383876116f7565b61091b838261178e565b8093505b505050919050565b61092f6117d9565b565b60408051808201909152601781527f4c6971756964207374616b656420457468657220322e30000000000000000000602082015290565b61092f6118b3565b600061097d33848461197c565b50600192915050565b604080517f6c69646f2e4c69646f2e696e737572616e636546756e64000000000000000000815290519081900360170190206000906109c490611588565b905090565b60006109c4611b0b565b6000806109de611b0b565b90508015156109f05760009150610a1b565b610a1881610a0c6109ff611b6d565b869063ffffffff611bab16565b9063ffffffff611c9a16565b91505b50919050565b600160a060020a038316600090815260016020908152604080832033845290915281205482811015610ac3576040805160e560020a62461bcd02815260206004820152602160248201527f5452414e534645525f414d4f554e545f455843454544535f414c4c4f57414e4360448201527f4500000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610ace858585611d3a565b610ae88533610ae3848763ffffffff611da316565b61197c565b506001949350505050565b604080517f6c69646f2e4c69646f2e6e6f64654f70657261746f72735265676973747279008152905190819003601f0190206000906109c490611588565b601290565b6801bc16d674ec80000081565b336000818152600160209081526040808320600160a060020a0387168452909152812054909161097d918590610ae3908663ffffffff611e3716565b604080517f6c69646f2e4c69646f2e74726561737572790000000000000000000000000000815290519081900360120190206000906109c490611588565b604080516000805160206138f883398151915281529051908190036018019020600090610be990611588565b15905090565b60006109c4611ec5565b606081565b604080517f6c69646f2e4c69646f2e7769746864726177616c43726564656e7469616c73008152905190819003601f0190206000906109c490611588565b6000610c4f610c4a83611f17565b610c6d565b92915050565b6000806000610c62611f32565b925092509250909192565b600080610c78611b6d565b9050801515610c8a5760009150610a1b565b610a1881610a0c6109ff611b0b565b610ca281611ff1565b50565b604080517f6c69646f2e4c69646f2e6f7261636c6500000000000000000000000000000000815290519081900360100190206000906109c490611588565b610d128161ffff16610d068461ffff168661ffff16611e3790919063ffffffff16565b9063ffffffff611e3716565b61271014610d6a576040805160e560020a62461bcd02815260206004820152601060248201527f464545535f444f4e545f4144445f555000000000000000000000000000000000604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e7472656173757279466565000000000000000000000081529051908190036015019020610da69084612033565b604080517f6c69646f2e4c69646f2e696e737572616e63654665650000000000000000000081529051908190036016019020610de29083612033565b604080517f6c69646f2e4c69646f2e6e6f64654f70657261746f72734665650000000000008152905190819003601a019020610e1e9082612033565b6040805161ffff8086168252808516602083015283168183015290517f034529db1bba3830b8877e116871f19c5b96ef86c739f2a05668c860c84668989181900360600190a1505050565b604080517f6c69646f2e4c69646f2e666565000000000000000000000000000000000000008152905190819003600d019020610ea59082612033565b6040805161ffff8316815290517faab062e3faf62b6c9a0f8e62af66e0310e27127a8c871a67be7dd4d93de6da539181900360200190a150565b610ca2816120a9565b60408051808201909152600581527f7374455448000000000000000000000000000000000000000000000000000000602082015290565b6000610c4f82610813565b602081565b336000908152600160209081526040808320600160a060020a038616845290915281205482811015610fab576040805160e560020a62461bcd02815260206004820152601e60248201527f4445435245415345445f414c4c4f57414e43455f42454c4f575f5a45524f0000604482015290519081900360640190fd5b610fc03385610ae3848763ffffffff611da316565b600191505b5092915050565b603081565b604080516000805160206138f883398151915281529051908190036018019020610ffa90611588565b151561103e576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b6040805160e560020a62461bcd02815260206004820152601360248201527f4e4f545f494d504c454d454e5445445f59455400000000000000000000000000604482015290519081900360640190fd5b600061097d338484611d3a565b604080517f6c69646f2e4c69646f2e6465706f736974436f6e747261637400000000000000815290519081900360190190206000906109c490611588565b604080516000805160206139188339815191528152905190819003601d0190206000908190819061110990611588565b604080516000805160206139588339815191528152905190819003601a01902090935061113590611588565b604080516000805160206138d88339815191528152905190819003601701902090925061116190611588565b9050909192565b610ca281612191565b60006109c4612233565b60006109c4611b6d565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b604080517f6c69646f2e4c69646f2e7769746864726177616c43726564656e7469616c73008152905190819003601f0190206111f2908263ffffffff61227116565b6111fa610af3565b600160a060020a031663f778021e6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561123757600080fd5b505af115801561124b573d6000803e3d6000fd5b50506040805184815290517f13eb80e900aa05a2696d50d5de33ef631c73493c4921da233b17335ff6b7b1149350908190036020019150a150565b61092f60106120a9565b600061129c8383612275565b9392505050565b610ca281612449565b60008060008060006112e460405180806000805160206138f88339815191528152506018019050604051809103902060001916611588565b1515611328576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b611330610ca5565b600160a060020a0316331461138f576040805160e560020a62461bcd02815260206004820152600f60248201527f4150505f415554485f4641494c45440000000000000000000000000000000000604482015290519081900360640190fd5b604080516000805160206139188339815191528152905190819003601d0190206113b890611588565b945084871115611412576040805160e560020a62461bcd02815260206004820152601760248201527f5245504f525445445f4d4f52455f4445504f5349544544000000000000000000604482015290519081900360640190fd5b604080516000805160206139588339815191528152905190819003601a01902061143b90611588565b935083871015611495576040805160e560020a62461bcd02815260206004820152601860248201527f5245504f525445445f4c4553535f56414c494441544f52530000000000000000604482015290519081900360640190fd5b6114a5878563ffffffff611da316565b604080516000805160206138d8833981519152815290519081900360170190209093506114ee906114d590611588565b610d06856801bc16d674ec80000063ffffffff611bab16565b604080516000805160206138d883398151915281529051908190036017019020909250611521908763ffffffff61227116565b604080516000805160206139588339815191528152905190819003601a019020611551908863ffffffff61227116565b8186111561157457611569868363ffffffff611da316565b9050611574816124eb565b50505050505050565b6000610c4f82611f17565b5490565b604080516000805160206138f8833981519152815290519081900360180190206000906115b890611588565b15156115fc576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b600160a060020a038316151561165c576040805160e560020a62461bcd02815260206004820152601860248201527f4d494e545f544f5f5448455f5a45524f5f414444524553530000000000000000604482015290519081900360640190fd5b61166882610d06611b6d565b604080517f6c69646f2e53744554482e746f74616c53686172657300000000000000000000815290519081900360160190209091506116ad908263ffffffff61227116565b600160a060020a0383166000908152602081905260409020546116d6908363ffffffff611e3716565b600160a060020a039093166000908152602081905260409020929092555090565b61174461170683610d06611ec5565b604080517f6c69646f2e4c69646f2e62756666657265644574686572000000000000000000815290519081900360170190209063ffffffff61227116565b60408051838152600160a060020a0383811660208301528251908616927f96a25c8ce0baabc1fdefd93e9ed25d8e092a3332f3aa9a41722b5697231d1d1a928290030190a2505050565b600160a060020a03821660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6117c484610c6d565b60408051918252519081900360200190a35050565b604080516000805160206138f88339815191528152905190819003601801902061180290611588565b15611857576040805160e560020a62461bcd02815260206004820152601260248201527f434f4e54524143545f49535f4143544956450000000000000000000000000000604482015290519081900360640190fd5b604080516000805160206138f88339815191528152905190819003601801902061188890600163ffffffff61227116565b6040517f62451d457bc659158be6e6247f56ec1df424a5c7597f71c20c2bc44e0965c8f990600090a1565b604080516000805160206138f8833981519152815290519081900360180190206118dc90611588565b1515611920576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b604080516000805160206138f88339815191528152905190819003601801902061195190600063ffffffff61227116565b6040517f7acc84e34091ae817647a4c49116f5cc07f319078ba80f8f5fde37ea7e25cbd690600090a1565b604080516000805160206138f8833981519152815290519081900360180190206119a590611588565b15156119e9576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b600160a060020a0383161515611a49576040805160e560020a62461bcd02815260206004820152601960248201527f415050524f56455f46524f4d5f5a45524f5f4144445245535300000000000000604482015290519081900360640190fd5b600160a060020a0382161515611aa9576040805160e560020a62461bcd02815260206004820152601760248201527f415050524f56455f544f5f5a45524f5f41444452455353000000000000000000604482015290519081900360640190fd5b600160a060020a03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600080600080611b19611ec5565b604080516000805160206138d883398151915281529051908190036017019020909350611b4590611588565b9150611b4f61260e565b9050611b6581610d06858563ffffffff611e3716565b935050505090565b604080517f6c69646f2e53744554482e746f74616c53686172657300000000000000000000815290519081900360160190206000906109c490611588565b600080831515611bbe5760009150610fc5565b50828202828482811515611bce57fe5b60408051808201909152601181527f4d4154485f4d554c5f4f564552464c4f5700000000000000000000000000000060208201529291900414611c925760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c57578181015183820152602001611c3f565b50505050905090810190601f168015611c845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b60408051808201909152600d81527f4d4154485f4449565f5a45524f0000000000000000000000000000000000000060208201526000908190818411611d255760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611c57578181015183820152602001611c3f565b508284811515611d3157fe5b04949350505050565b6000611d45826109d3565b9050611d528484836126a3565b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b60408051808201909152601281527f4d4154485f5355425f554e444552464c4f5700000000000000000000000000006020820152600090819084841115611e2f5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611c57578181015183820152602001611c3f565b505050900390565b60408051808201909152601181527f4d4154485f4144445f4f564552464c4f5700000000000000000000000000000060208201526000908383019084821015611c925760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611c57578181015183820152602001611c3f565b604080517f6c69646f2e4c69646f2e62756666657265644574686572000000000000000000815290519081900360170190206000908190611f0590611588565b90503031811115611f1257fe5b919050565b600160a060020a031660009081526020819052604090205490565b6000806000611f7560405180807f6c69646f2e4c69646f2e74726561737572794665650000000000000000000000815250601501905060405180910390206128ac565b604080517f6c69646f2e4c69646f2e696e737572616e63654665650000000000000000000081529051908190036016019020909350611fb3906128ac565b604080517f6c69646f2e4c69646f2e6e6f64654f70657261746f72734665650000000000008152905190819003601a019020909250611161906128ac565b604080517f6c69646f2e4c69646f2e6f7261636c650000000000000000000000000000000081529051908190036010019020610ca2908263ffffffff61227116565b61271061ffff82161115612091576040805160e560020a62461bcd02815260206004820152601660248201527f56414c55455f4f5645525f3130305f50455243454e5400000000000000000000604482015290519081900360640190fd5b6120a58261ffff831663ffffffff61227116565b5050565b604080516000805160206138f883398151915281529051908190036018019020600090819081906120d990611588565b151561211d576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b612125611ec5565b92506801bc16d674ec800000831061218b5761213f6128ca565b915061215a836801bc16d674ec80000063ffffffff611c9a16565b905061217b61217685831061216f5785612171565b825b6128e5565b612c67565b816121846128ca565b1461218b57fe5b50505050565b600160a060020a03811615156121f1576040805160e560020a62461bcd02815260206004820152601f60248201527f5345545f494e535552414e43455f46554e445f5a45524f5f4144445245535300604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e696e737572616e636546756e6400000000000000000081529051908190036017019020610ca2908263ffffffff61227116565b604080517f6c69646f2e4c69646f2e666565000000000000000000000000000000000000008152905190819003600d0190206000906109c4906128ac565b9055565b604080516000805160206138f88339815191528152905190819003601801902060009081906122a390611588565b15156122e7576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b600160a060020a0384161515612347576040805160e560020a62461bcd02815260206004820152601a60248201527f4255524e5f46524f4d5f5448455f5a45524f5f41444452455353000000000000604482015290519081900360640190fd5b50600160a060020a038316600090815260208190526040902054808311156123b9576040805160e560020a62461bcd02815260206004820152601b60248201527f4255524e5f414d4f554e545f455843454544535f42414c414e43450000000000604482015290519081900360640190fd5b6123d1836123c5611b6d565b9063ffffffff611da316565b604080517f6c69646f2e53744554482e746f74616c5368617265730000000000000000000081529051908190036016019020909250612416908363ffffffff61227116565b612426818463ffffffff611da316565b600160a060020a0390941660009081526020819052604090209390935592915050565b600160a060020a03811615156124a9576040805160e560020a62461bcd02815260206004820152601960248201527f5345545f54524541535552595f5a45524f5f4144445245535300000000000000604482015290519081900360640190fd5b604080517f6c69646f2e4c69646f2e7472656173757279000000000000000000000000000081529051908190036012019020610ca2908263ffffffff61227116565b6000806000806000806000806000612501612233565b61ffff16985061255261253761251d8b8d63ffffffff611bab16565b6123c561271061252b611b0b565b9063ffffffff611bab16565b610a0c612542611b6d565b61252b8e8e63ffffffff611bab16565b975061255e308961158c565b50612567611f32565b90985096506125889050612710610a0c8a61ffff8b1663ffffffff611bab16565b9450612592610986565b935061259f3085876126a3565b6125a9848661178e565b6125cb6125c6612710610a0c8b61ffff8b1663ffffffff611bab16565b612ce2565b92506125e1836123c58a8863ffffffff611da316565b91506125eb610b7f565b90506125f83082846126a3565b612602818361178e565b50505050505050505050565b604080516000805160206139188339815191528152905190819003601d01902060009081908190819061264090611588565b604080516000805160206139588339815191528152905190819003601a01902090935061266c90611588565b91508183101561267857fe5b612688838363ffffffff611da316565b9050611b65816801bc16d674ec80000063ffffffff611bab16565b604080516000805160206138f8833981519152815290519081900360180190206000906126cf90611588565b1515612713576040805160e560020a62461bcd0281526020600482015260136024820152600080516020613938833981519152604482015290519081900360640190fd5b600160a060020a0384161515612773576040805160e560020a62461bcd02815260206004820152601e60248201527f5452414e534645525f46524f4d5f5448455f5a45524f5f414444524553530000604482015290519081900360640190fd5b600160a060020a03831615156127d3576040805160e560020a62461bcd02815260206004820152601c60248201527f5452414e534645525f544f5f5448455f5a45524f5f4144445245535300000000604482015290519081900360640190fd5b50600160a060020a03831660009081526020819052604090205480821115612845576040805160e560020a62461bcd02815260206004820152601f60248201527f5452414e534645525f414d4f554e545f455843454544535f42414c414e434500604482015290519081900360640190fd5b612855818363ffffffff611da316565b600160a060020a03808616600090815260208190526040808220939093559085168152205461288a908363ffffffff611e3716565b600160a060020a03909316600090815260208190526040902092909255505050565b6000806128b883611588565b9050612710811115610c4f57fe5b9055565b60006109c46128d7611ec5565b30319063ffffffff611da316565b60006060806000806060806128f8610af3565b600160a060020a03166341bc716f896040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b15801561294057600080fd5b505af1158015612954573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561297d57600080fd5b81019080805164010000000081111561299557600080fd5b820160208101848111156129a857600080fd5b81516401000000008111828201871017156129c257600080fd5b505092919060200180516401000000008111156129de57600080fd5b820160208101848111156129f157600080fd5b8151640100000000811182820187101715612a0b57600080fd5b50508451949a50985050509015159050612a285760009650612c5c565b8551612a3b90603063ffffffff612ed616565b15612ab6576040805160e560020a62461bcd02815260206004820152602160248201527f52454749535452595f494e434f4e53495354454e545f5055424b4559535f4c4560448201527f4e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8451612ac990606063ffffffff612ed616565b15612b1e576040805160e560020a62461bcd02815260206004820152601d60248201527f52454749535452595f494e434f4e53495354454e545f5349475f4c454e000000604482015290519081900360640190fd5b8551612b3190603063ffffffff611c9a16565b8551909450612b4790606063ffffffff611c9a16565b8414612b9d576040805160e560020a62461bcd02815260206004820152601f60248201527f52454749535452595f494e434f4e53495354454e545f5349475f434f554e5400604482015290519081900360640190fd5b600092505b83831015612be157612bb986603085026030612f73565b9150612bca85606085026060612f73565b9050612bd68282612ff4565b826001019250612ba2565b604080516000805160206139188339815191528152905190819003601d019020612c4090612c14908690610d0690611588565b604080516000805160206139188339815191528152905190819003601d0190209063ffffffff61227116565b612c59846801bc16d674ec80000063ffffffff611bab16565b96505b505050505050919050565b604080517f6c69646f2e4c69646f2e6275666665726564457468657200000000000000000081529051908190036017019020612cac906117069083906123c590611588565b6040805182815290517f76a397bea5768d4fca97ef47792796e35f98dc81b16c1de84e28a818e1f971089181900360200190a150565b60006060806000612cf1610af3565b600160a060020a03166362dcfda1866040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b158015612d3957600080fd5b505af1158015612d4d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015612d7657600080fd5b810190808051640100000000811115612d8e57600080fd5b82016020810184811115612da157600080fd5b8151856020820283011164010000000082111715612dbe57600080fd5b50509291906020018051640100000000811115612dda57600080fd5b82016020810184811115612ded57600080fd5b8151856020820283011164010000000082111715612e0a57600080fd5b50509291905050509250925081518351141515612e2357fe5b5060009250825b825181101561091f57612e6c308483815181101515612e4557fe5b906020019060200201518484815181101515612e5d57fe5b906020019060200201516126a3565b612ea48382815181101515612e7d57fe5b906020019060200201518383815181101515612e9557fe5b9060200190602002015161178e565b612ecc8282815181101515612eb557fe5b60209081029091010151859063ffffffff611e3716565b9350600101612e2a565b60408051808201909152600d81527f4d4154485f4449565f5a45524f000000000000000000000000000000000000006020820152600090821515612f5f5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015611c57578181015183820152602001611c3f565b508183811515612f6b57fe5b069392505050565b606080828401855110151515612f8857600080fd5b82158015612fa157604051915060208201604052612feb565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612fda578051835260209283019201612fc2565b5050858452601f01601f1916604052505b50949350505050565b6000806000806000806000613007610bfe565b9650861515613060576040805160e560020a62461bcd02815260206004820152601c60248201527f454d5054595f5749544844524157414c5f43524544454e5449414c5300000000604482015290519081900360640190fd5b6801bc16d674ec800000955061308086633b9aca0063ffffffff611c9a16565b94508561309786633b9aca0063ffffffff611bab16565b1461309e57fe5b60026130a98a61377c565b6040518082805190602001908083835b602083106130d85780518252601f1990920191602091820191016130b9565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af1158015613119573d6000803e3d6000fd5b5050506040513d602081101561312e57600080fd5b505193506002806131428a60006040612f73565b6040518082805190602001908083835b602083106131715780518252601f199092019160209182019101613152565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af11580156131b2573d6000803e3d6000fd5b5050506040513d60208110156131c757600080fd5b505160026131ef6131ea8c60406131e560608263ffffffff611da316565b612f73565b61377c565b6040518082805190602001908083835b6020831061321e5780518252601f1990920191602091820191016131ff565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af115801561325f573d6000803e3d6000fd5b5050506040513d602081101561327457600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b602083106132ca5780518252601f1990920191602091820191016132ab565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af115801561330b573d6000803e3d6000fd5b5050506040513d602081101561332057600080fd5b50516040805160208181018890528183018b905282518083038401815260609092019283905281519396506002938493918291908401908083835b6020831061337a5780518252601f19909201916020918201910161335b565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af11580156133bb573d6000803e3d6000fd5b5050506040513d60208110156133d057600080fd5b505160026133dd8861380c565b60408051602080820193909352808201899052815180820383018152606090910191829052805190928291908401908083835b6020831061342f5780518252601f199092019160209182019101613410565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af1158015613470573d6000803e3d6000fd5b5050506040513d602081101561348557600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b602083106134db5780518252601f1990920191602091820191016134bc565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af115801561351c573d6000803e3d6000fd5b5050506040513d602081101561353157600080fd5b5051915061354630318763ffffffff611da316565b905061355061109b565b600160a060020a03166322895118878b8a6040516020018082600019166000191681526020019150506040516020818303038152906040528c876040518663ffffffff1660e060020a028152600401808060200180602001806020018560001916600019168152602001848103845288818151815260200191508051906020019080838360005b838110156135ef5781810151838201526020016135d7565b50505050905090810190601f16801561361c5780820380516001836020036101000a031916815260200191505b50848103835287518152875160209182019189019080838360005b8381101561364f578181015183820152602001613637565b50505050905090810190601f16801561367c5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b838110156136af578181015183820152602001613697565b50505050905090810190601f1680156136dc5780820380516001836020036101000a031916815260200191505b509750505050505050506000604051808303818588803b1580156136ff57600080fd5b505af1158015613713573d6000803e3d6000fd5b50505050303182149050613771576040805160e560020a62461bcd02815260206004820152601b60248201527f455850454354494e475f4445504f5349545f544f5f48415050454e0000000000604482015290519081900360640190fd5b505050505050505050565b606080602083511015801561379357506040835111155b151561379b57fe5b8251604014156137ad57829150610a1b565b6040805160208082528183019092529080820161040080388339019050509050600060208201528251602014156137e857610a18838261385c565b610a18836138078360006131e588516040611da390919063ffffffff16565b61385c565b600081815b60088110156138325761010092830260ff8316179290910490600101613811565b811561383a57fe5b5050780100000000000000000000000000000000000000000000000002919050565b6060806040519050835180825260208201818101602087015b8183101561388d578051835260209283019201613875565b50855184518101855292509050808201602086015b818310156138ba5780518352602092830192016138a2565b509551919091011594909401601f01601f1916604052939250505056006c69646f2e4c69646f2e626561636f6e42616c616e63650000000000000000006c69646f2e5061757361626c652e616374697665466c616700000000000000006c69646f2e4c69646f2e6465706f736974656456616c696461746f7273000000434f4e54524143545f49535f53544f50504544000000000000000000000000006c69646f2e4c69646f2e626561636f6e56616c696461746f7273000000000000a165627a7a72305820d12491b4fde01ad32eca3a31ac501ebbadf3db48ddc020690fc147dc4fb1fed10029` 7 | lidoMEVdistribByteCode = `0x608060405234801561001057600080fd5b50604051610a7f380380610a7f83398101604081905261002f9161006d565b670de0b6b3a764000081111561004457600080fd5b600080546001600160a01b0319166001600160a01b0393909316929092179091556001556100a5565b6000806040838503121561007f578182fd5b82516001600160a01b0381168114610095578283fd5b6020939093015192949293505050565b6109cb806100b46000396000f3fe6080604052600436106100385760003560e01c80633c45a3d21461007757806369571ba114610081578063afa724e8146100be57600080fd5b36610072576040513481527f0a6e8c861fe004b2c9d6d3dd59541d622fb4c6dbb805375df34b31b516c89d409060200160405180910390a1005b600080fd5b61007f6100e2565b005b34801561008d57600080fd5b506000546100a1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100ca57600080fd5b506100d460015481565b6040519081526020016100b5565b341561011c576040513481527f0a6e8c861fe004b2c9d6d3dd59541d622fb4c6dbb805375df34b31b516c89d409060200160405180910390a15b478061012757600080fd5b60005460405163a1903eab60e01b81523060048201526001600160a01b0390911690819063a1903eab9084906024016020604051808303818588803b15801561016f57600080fd5b505af1158015610183573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101a89190610873565b506000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101e457600080fd5b505afa1580156101f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021c9190610873565b90506000826001600160a01b031663d5002f2e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561025957600080fd5b505afa15801561026d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102919190610873565b604051633d7ad0b760e21b81523060048201529091506000906001600160a01b0385169063f5eb42dc9060240160206040518083038186803b1580156102d657600080fd5b505afa1580156102ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030e9190610873565b905060008261031d8584610900565b61032791906108e0565b90506000670de0b6b3a7640000600154836103429190610900565b61034c91906108e0565b9050600061035a828761091f565b610364858761091f565b61036e9084610900565b61037891906108e0565b90506000610386828661091f565b905061039282896103da565b61039c8189610676565b6040518981527ffada74d188be3c06536ca96cc80440684fa5d1ecddf2989e65815ec63418bcce9060200160405180910390a1505050505050505050565b604051630f451f7160e31b8152600481018390526000906001600160a01b03831690637a28fb889060240160206040518083038186803b15801561041d57600080fd5b505afa158015610431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104559190610873565b9050600080836001600160a01b03166327a099d86040518163ffffffff1660e01b815260040160206040518083038186803b15801561049357600080fd5b505afa1580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610857565b6001600160a01b03166362dcfda1846040518263ffffffff1660e01b81526004016104f891815260200190565b60006040518083038186803b15801561051057600080fd5b505afa158015610524573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261054c919081019061076a565b91509150805182511461056f57634e487b7160e01b600052600160045260246000fd5b60005b825181101561066e57846001600160a01b031663a9059cbb8483815181106105aa57634e487b7160e01b600052603260045260246000fd5b60200260200101518484815181106105d257634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b815260040161060b9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561062557600080fd5b505af1158015610639573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065d9190610830565b5061066781610936565b9050610572565b505050505050565b604051633b9e9f0160e21b8152306004820152602481018390526001600160a01b0382169063ee7a7c0490604401602060405180830381600087803b1580156106be57600080fd5b505af11580156106d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f69190610873565b505050565b600082601f83011261070b578081fd5b8151602061072061071b836108bc565b61088b565b80838252828201915082860187848660051b890101111561073f578586fd5b855b8581101561075d57815184529284019290840190600101610741565b5090979650505050505050565b6000806040838503121561077c578182fd5b825167ffffffffffffffff80821115610793578384fd5b818501915085601f8301126107a6578384fd5b815160206107b661071b836108bc565b8083825282820191508286018a848660051b89010111156107d5578889fd5b8896505b848710156108005780516107ec8161097d565b8352600196909601959183019183016107d9565b5091880151919650909350505080821115610819578283fd5b50610826858286016106fb565b9150509250929050565b600060208284031215610841578081fd5b81518015158114610850578182fd5b9392505050565b600060208284031215610868578081fd5b81516108508161097d565b600060208284031215610884578081fd5b5051919050565b604051601f8201601f1916810167ffffffffffffffff811182821017156108b4576108b4610967565b604052919050565b600067ffffffffffffffff8211156108d6576108d6610967565b5060051b60200190565b6000826108fb57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561091a5761091a610951565b500290565b60008282101561093157610931610951565b500390565b600060001982141561094a5761094a610951565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461099257600080fd5b5056fea2646970667358221220d6df9704127b796786f62f7273e81f60b9377c68ca9b364c7646000c02b2bf1664736f6c63430008040033` 8 | lightPrismByteCode = `0x608060405234801561001057600080fd5b5061089e806100206000396000f3fe6080604052600436106100435760003560e01c8063132bd3a91461005757806316de13351461006157806320eda6d51461008a578063c4d3f9d9146100c757610052565b36610052576100506100d1565b005b600080fd5b61005f6102b7565b005b34801561006d57600080fd5b50610088600480360381019061008391906105b8565b6102b9565b005b34801561009657600080fd5b506100b160048036038101906100ac919061058f565b610408565b6040516100be91906106db565b60405180910390f35b6100cf610420565b005b60006100dc4161042a565b90506000479050600060036002836100f49190610727565b6100fe91906106f6565b9050600060038361010f91906106f6565b9050600084602001519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146101545780610156565b415b9050600085600001519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461019b578061019d565b415b9050856020015173ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501580156101e9573d6000803e3d6000fd5b50856000015173ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610234573d6000803e3d6000fd5b507f95b37ac100e4bf5cd43ff3a48e440813330509e42025bdc7e778b7fa4e2a0c184183338760405161026a949392919061065f565b60405180910390a17f95b37ac100e4bf5cd43ff3a48e440813330509e42025bdc7e778b7fa4e2a0c18418233866040516102a7949392919061065f565b60405180910390a1505050505050565b565b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff168152506000804173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507fe087daf3fdb9d24fa12fd74aac07b157d41f74e4a6671e0c858f8b8310ca609f3383836040516103fc939291906106a4565b60405180910390a15050565b610410610534565b6104198261042a565b9050919050565b6104286100d1565b565b610432610534565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905080915050919050565b6040518060400160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b60008135905061058981610851565b92915050565b6000602082840312156105a157600080fd5b60006105af8482850161057a565b91505092915050565b600080604083850312156105cb57600080fd5b60006105d98582860161057a565b92505060206105ea8582860161057a565b9150509250929050565b6105fd816107bd565b82525050565b61060c81610781565b82525050565b61061b81610781565b82525050565b6040820160008201516106376000850182610603565b50602082015161064a6020850182610603565b50505050565b610659816107b3565b82525050565b600060808201905061067460008301876105f4565b6106816020830186610612565b61068e6040830185610612565b61069b6060830184610650565b95945050505050565b60006060820190506106b96000830186610612565b6106c66020830185610612565b6106d36040830184610612565b949350505050565b60006040820190506106f06000830184610621565b92915050565b6000610701826107b3565b915061070c836107b3565b92508261071c5761071b610822565b5b828204905092915050565b6000610732826107b3565b915061073d836107b3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610776576107756107f3565b5b828202905092915050565b600061078c82610793565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006107c8826107cf565b9050919050565b60006107da826107e1565b9050919050565b60006107ec82610793565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b61085a81610781565b811461086557600080fd5b5056fea26469706673582212200e1be7747fff0819a0cfddb089a6be7a9dbc58972bad5929bb8a1f3c7bec7ed064736f6c63430008040033` 9 | 10 | ) 11 | -------------------------------------------------------------------------------- /payments/contracts/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @dev Interface of the ERC20 standard as defined in the EIP. 7 | */ 8 | interface IERC20 { 9 | /** 10 | * @dev Returns the amount of tokens in existence. 11 | */ 12 | function totalSupply() external view returns (uint256); 13 | 14 | /** 15 | * @dev Returns the amount of tokens owned by `account`. 16 | */ 17 | function balanceOf(address account) external view returns (uint256); 18 | 19 | /** 20 | * @dev Moves `amount` tokens from the caller's account to `recipient`. 21 | * 22 | * Returns a boolean value indicating whether the operation succeeded. 23 | * 24 | * Emits a {Transfer} event. 25 | */ 26 | function transfer(address recipient, uint256 amount) external returns (bool); 27 | 28 | /** 29 | * @dev Returns the remaining number of tokens that `spender` will be 30 | * allowed to spend on behalf of `owner` through {transferFrom}. This is 31 | * zero by default. 32 | * 33 | * This value changes when {approve} or {transferFrom} are called. 34 | */ 35 | function allowance(address owner, address spender) 36 | external 37 | view 38 | returns (uint256); 39 | 40 | /** 41 | * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. 42 | * 43 | * Returns a boolean value indicating whether the operation succeeded. 44 | * 45 | * IMPORTANT: Beware that changing an allowance with this method brings the risk 46 | * that someone may use both the old and the new allowance by unfortunate 47 | * transaction ordering. One possible solution to mitigate this race 48 | * condition is to first reduce the spender's allowance to 0 and set the 49 | * desired value afterwards: 50 | * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 51 | * 52 | * Emits an {Approval} event. 53 | */ 54 | function approve(address spender, uint256 amount) external returns (bool); 55 | 56 | /** 57 | * @dev Moves `amount` tokens from `sender` to `recipient` using the 58 | * allowance mechanism. `amount` is then deducted from the caller's 59 | * allowance. 60 | * 61 | * Returns a boolean value indicating whether the operation succeeded. 62 | * 63 | * Emits a {Transfer} event. 64 | */ 65 | function transferFrom( 66 | address sender, 67 | address recipient, 68 | uint256 amount 69 | ) external returns (bool); 70 | 71 | /** 72 | * @dev Emitted when `value` tokens are moved from one account (`from`) to 73 | * another (`to`). 74 | * 75 | * Note that `value` may be zero. 76 | */ 77 | event Transfer(address indexed from, address indexed to, uint256 value); 78 | 79 | /** 80 | * @dev Emitted when the allowance of a `spender` for an `owner` is set by 81 | * a call to {approve}. `value` is the new allowance. 82 | */ 83 | event Approval(address indexed owner, address indexed spender, uint256 value); 84 | } 85 | -------------------------------------------------------------------------------- /payments/contracts/LidoMevDistributor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity 0.8.4; 4 | 5 | 6 | interface INodeOperatorsRegistry { 7 | function getRewardsDistribution(uint256 _totalRewardShares) 8 | external view returns ( 9 | address[] memory recipients, 10 | uint256[] memory shares 11 | ); 12 | } 13 | 14 | 15 | interface ILido { 16 | function totalSupply() external view returns (uint256); 17 | function getTotalShares() external view returns (uint256); 18 | function submit(address _referral) external payable returns (uint256 sharesMinted); 19 | function sharesOf(address _account) external view returns (uint256); 20 | function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256); 21 | function burnShares(address _account, uint256 _amount) external returns (uint256 newTotalShares); 22 | function transfer(address _recipient, uint256 _amount) external returns (bool); 23 | function getOperators() external view returns (INodeOperatorsRegistry); 24 | } 25 | 26 | 27 | contract LidoMevDistributor { 28 | event LidoMevReceived(uint256 amount); 29 | event LidoMevDistributed(uint256 amount); 30 | 31 | address public lidoAddress; 32 | uint256 public validatorsMevShare; 33 | 34 | constructor(address _lidoAddress, uint256 _validatorsMevShare) { 35 | require(_validatorsMevShare <= 10**18); 36 | lidoAddress = _lidoAddress; 37 | validatorsMevShare = _validatorsMevShare; 38 | } 39 | 40 | receive() external payable { 41 | emit LidoMevReceived(msg.value); 42 | } 43 | 44 | function distribureMev() external payable { 45 | if (msg.value > 0) { 46 | emit LidoMevReceived(msg.value); 47 | } 48 | 49 | uint256 totalEth = address(this).balance; 50 | require(totalEth > 0); 51 | 52 | ILido lido = ILido(lidoAddress); 53 | lido.submit{value: totalEth}(address(this)); 54 | 55 | uint256 stEthTotalSupply = lido.totalSupply(); 56 | uint256 prevTotalShares = lido.getTotalShares(); 57 | 58 | uint256 sharesToDistribute = lido.sharesOf(address(this)); 59 | uint256 stEthToDistribute = sharesToDistribute * stEthTotalSupply / prevTotalShares; 60 | uint256 validatorsStEth = (stEthToDistribute * validatorsMevShare) / 10**18; 61 | 62 | // Since we're burning part of the shares, each non-burnt share will become more expensive, 63 | // including the shares we're going to transfer to validators: 64 | // 65 | // newStEthByShare = stEthTotalSupply / (prevTotalShares - stakersShares) 66 | // validatorsStEth = validatorsShares * newStEthByShare 67 | // validatorsShares + stakersShares = sharesToDistribute 68 | // 69 | // We need to account for this in order to distribure the received stETH between validators 70 | // and stakers in a given proportion: 71 | // 72 | // validatorsShares * newStEthByShare = validatorsStEth 73 | // validatorsShares * stEthTotalSupply / (prevTotalShares - sharesToDistribute + validatorsShares) = validatorsStEth 74 | // validatorsShares * stEthTotalSupply = validatorsStEth * (prevTotalShares - sharesToDistribute + validatorsShares) 75 | // validatorsShares * (stEthTotalSupply - validatorsStEth) = validatorsStEth * (prevTotalShares - sharesToDistribute) 76 | // validatorsShares = validatorsStEth * (prevTotalShares - sharesToDistribute) / (stEthTotalSupply - validatorsStEth) 77 | 78 | uint256 validatorsShares = validatorsStEth * 79 | (prevTotalShares - sharesToDistribute) / 80 | (stEthTotalSupply - validatorsStEth); 81 | 82 | uint256 stakersShares = sharesToDistribute - validatorsShares; 83 | 84 | _distributeValidatorsMev(validatorsShares, lido); 85 | _distributeStakersMev(stakersShares, lido); 86 | 87 | emit LidoMevDistributed(totalEth); 88 | } 89 | 90 | function _distributeValidatorsMev(uint256 sharesAmount, ILido lido) internal { 91 | uint256 stEthAmount = lido.getPooledEthByShares(sharesAmount); 92 | 93 | (address[] memory recipients, uint256[] memory amounts) = 94 | lido.getOperators().getRewardsDistribution(stEthAmount); 95 | 96 | assert(recipients.length == amounts.length); 97 | 98 | for (uint256 i = 0; i < recipients.length; ++i) { 99 | lido.transfer(recipients[i], amounts[i]); 100 | } 101 | } 102 | 103 | function _distributeStakersMev(uint256 sharesAmount, ILido lido) internal { 104 | // Burn the pool share. This would increase all other stakers' shares price, 105 | // effectively distributing the received ETH between the stakers. 106 | lido.burnShares(address(this), sharesAmount); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /payments/contracts/LightPrism.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.4; 3 | 4 | struct Recipients { 5 | address executor; 6 | address stakingPool; 7 | } 8 | 9 | contract LightPrism { 10 | mapping(address => Recipients) private _recipients; 11 | 12 | event FlashbotsPayment( 13 | address coinbase, 14 | address receivingAddress, 15 | address msgSender, 16 | uint256 amount 17 | ); 18 | 19 | event RecipientUpdate( 20 | address coinbase, 21 | address executor, 22 | address stakingPool 23 | ); 24 | 25 | receive() external payable { 26 | _payMiner(); 27 | } 28 | 29 | function setRecipients(address executor, address stakingPool) external { 30 | // just simplify for now <- this should only be valid of msg.sender is coinbase 31 | _recipients[block.coinbase] = Recipients(executor, stakingPool); 32 | emit RecipientUpdate(msg.sender, executor, stakingPool); 33 | } 34 | 35 | function _getRecipients(address _who) 36 | private 37 | view 38 | returns (Recipients memory) 39 | { 40 | Recipients memory recipients = _recipients[_who]; 41 | return recipients; 42 | } 43 | 44 | function getRecipients(address _who) 45 | external 46 | view 47 | returns (Recipients memory) 48 | { 49 | return _getRecipients(_who); 50 | } 51 | 52 | function _payMiner() private { 53 | Recipients memory recipients = _getRecipients(block.coinbase); 54 | uint256 amount = address(this).balance; 55 | uint256 poolShare = (amount * 2) / 3; 56 | uint256 executorShare = amount / 3; 57 | 58 | address stakingPool = recipients.stakingPool; 59 | stakingPool = (stakingPool == address(0)) ? block.coinbase : stakingPool; 60 | 61 | address executor = recipients.executor; 62 | executor = (executor == address(0)) ? block.coinbase : executor; 63 | 64 | // here 2/3 and 1/3 split for simplicity 65 | payable(recipients.stakingPool).transfer(poolShare); 66 | payable(recipients.executor).transfer(executorShare); 67 | emit FlashbotsPayment(block.coinbase, stakingPool, msg.sender, poolShare); 68 | emit FlashbotsPayment(block.coinbase, executor, msg.sender, executorShare); 69 | } 70 | 71 | function payMiner() external payable { 72 | _payMiner(); 73 | } 74 | 75 | function queueEther() external payable {} 76 | } 77 | -------------------------------------------------------------------------------- /payments/contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity 0.8.4; 3 | 4 | contract Migrations { 5 | address public owner = msg.sender; 6 | uint public last_completed_migration; 7 | 8 | modifier restricted() { 9 | require( 10 | msg.sender == owner, 11 | "This function is restricted to the contract's owner" 12 | ); 13 | _; 14 | } 15 | 16 | function setCompleted(uint completed) public restricted { 17 | last_completed_migration = completed; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /payments/curlcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | function check() { 5 | curl \ 6 | -X POST \ 7 | -H 'content-type:application/json' \ 8 | --data '{"id":1,"jsonrpc":"2.0","method":"eth_getCode","params":["0xcc71dfd118f723049ab3d79ea6d1b34b8b4c928a"]}' \ 9 | http://138.68.75.41:8545 10 | } 11 | 12 | check 13 | -------------------------------------------------------------------------------- /payments/deployed-addrs.json: -------------------------------------------------------------------------------- 1 | { 2 | "LightPrismAddr": "0xcc71dfd118f723049ab3d79ea6d1b34b8b4c928a", 3 | "LidoContractAddr": "0x5d6d0199912b58220ac15661427af6bf53926385", 4 | "LidoMEVContractAddr": "0x6e0332bf5cf40cb789747b7364b10737f8010e26", 5 | "DepositContractAddr": "0xcd8f645f11442629df10c14f07e71dec56995d63", 6 | "NodeOperatorsRegistryAddr": "0xcb8c87a2dddcb846df0027647e07a3423b94995e", 7 | "OracleAddr": "0x756ac76d26f4c9055999c027ee2069ae77107a32" 8 | } -------------------------------------------------------------------------------- /payments/go.mod: -------------------------------------------------------------------------------- 1 | module watch_for_arb 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/ALTree/bigfloat v0.0.0-20180506151649-b176f1e721fc 7 | github.com/c-bata/go-prompt v0.2.5 8 | github.com/ethereum/go-ethereum v1.9.23 9 | github.com/gizak/termui/v3 v3.1.0 10 | github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible 11 | github.com/pkg/errors v0.8.1 12 | github.com/pkg/profile v1.5.0 13 | github.com/soniakeys/perm v1.0.0 14 | github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 15 | github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca 16 | github.com/technoweenie/multipartstreamer v1.0.1 // indirect 17 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 18 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e 19 | gonum.org/v1/gonum v0.8.1 20 | ) 21 | -------------------------------------------------------------------------------- /payments/go.sum: -------------------------------------------------------------------------------- 1 | github.com/ALTree/bigfloat v0.0.0-20180506151649-b176f1e721fc/go.mod h1:9hy2NiNR6kJzY3N2dE/x+UQtZXiYkjTRADHpAo6p9zI= 2 | github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= 3 | github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= 4 | github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= 5 | github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= 6 | github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= 7 | github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= 8 | github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= 9 | github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= 10 | github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 11 | github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 12 | github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= 13 | github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= 14 | github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= 15 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 16 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 17 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 18 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= 19 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= 20 | github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= 21 | github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= 22 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 23 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 24 | github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= 25 | github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 h1:rtI0fD4oG/8eVokGVPYJEW1F88p1ZNgXiEIs9thEE4A= 26 | github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= 27 | github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= 28 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 29 | github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6 h1:Eey/GGQ/E5Xp1P2Lyx1qj007hLZfbi0+CoVeJruGCtI= 30 | github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= 31 | github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= 32 | github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= 33 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 34 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 35 | github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= 36 | github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 37 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 38 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 39 | github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= 40 | github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= 41 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 42 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 43 | github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= 44 | github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= 45 | github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= 46 | github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= 47 | github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= 48 | github.com/ethereum/go-ethereum v1.9.23 h1:SIKhg/z4Q7AbvqcxuPYvMxf36che/Rq/Pp0IdYEkbtw= 49 | github.com/ethereum/go-ethereum v1.9.23/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM= 50 | github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 51 | github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= 52 | github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= 53 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 54 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 55 | github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= 56 | github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY= 57 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 58 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 59 | github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= 60 | github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= 61 | github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= 62 | github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= 63 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 64 | github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= 65 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 66 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= 67 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 68 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 69 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 70 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 71 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 72 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 73 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 74 | github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 75 | github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 76 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 77 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 78 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 79 | github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 80 | github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989 h1:giknQ4mEuDFmmHSrGcbargOuLHQGtywqo4mheITex54= 81 | github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= 82 | github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= 83 | github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 84 | github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= 85 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 86 | github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= 87 | github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= 88 | github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= 89 | github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= 90 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= 91 | github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 92 | github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= 93 | github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= 94 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 95 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 96 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 97 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 98 | github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= 99 | github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 100 | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= 101 | github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= 102 | github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= 103 | github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= 104 | github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 105 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 106 | github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= 107 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 108 | github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 109 | github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 110 | github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 111 | github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 112 | github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 113 | github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= 114 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 115 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 116 | github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= 117 | github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= 118 | github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= 119 | github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= 120 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 121 | github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 122 | github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= 123 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 124 | github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= 125 | github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= 126 | github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= 127 | github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= 128 | github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= 129 | github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= 130 | github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= 131 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 132 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 133 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 134 | github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= 135 | github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= 136 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 137 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 138 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 139 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 140 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 141 | github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 142 | github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= 143 | github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= 144 | github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= 145 | github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 146 | github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= 147 | github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= 148 | github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 149 | github.com/soniakeys/perm v1.0.0/go.mod h1:GYgknGm675c6XieNY6kkN2521j529sceN36WtbIIA5o= 150 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 151 | github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= 152 | github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= 153 | github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= 154 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 155 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 156 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 157 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 158 | github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= 159 | github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= 160 | github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= 161 | github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= 162 | github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= 163 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 164 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 165 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 166 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= 167 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 168 | golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 169 | golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 170 | golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 171 | golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= 172 | golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= 173 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 174 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 175 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 176 | golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= 177 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 178 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 179 | golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 180 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 181 | golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 182 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 183 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 184 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 185 | golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 186 | golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 187 | golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 188 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 189 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 190 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 191 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 192 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 193 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 194 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 195 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 196 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 197 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 198 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 199 | golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 200 | golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 201 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 202 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 203 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 204 | golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 205 | golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 206 | golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 207 | golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 208 | golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8= 209 | golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 210 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 211 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 212 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 213 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 214 | golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 215 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 216 | golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 217 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 218 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 219 | golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 220 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 221 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 222 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 223 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 224 | gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= 225 | gonum.org/v1/gonum v0.8.1/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= 226 | gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= 227 | gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= 228 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 229 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 230 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 231 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 232 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 233 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 234 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 235 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 236 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 237 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 238 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= 239 | gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= 240 | gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= 241 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 242 | gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= 243 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 244 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 245 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 246 | gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= 247 | rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 248 | -------------------------------------------------------------------------------- /payments/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "crypto/ecdsa" 6 | "encoding/json" 7 | "flag" 8 | "fmt" 9 | "io/ioutil" 10 | "log" 11 | "math/big" 12 | "math/rand" 13 | "strings" 14 | "time" 15 | 16 | "github.com/ethereum/go-ethereum" 17 | "github.com/ethereum/go-ethereum/accounts/abi" 18 | "github.com/ethereum/go-ethereum/common" 19 | m "github.com/ethereum/go-ethereum/common/math" 20 | "github.com/ethereum/go-ethereum/core/types" 21 | "github.com/ethereum/go-ethereum/crypto" 22 | "github.com/ethereum/go-ethereum/ethclient" 23 | "github.com/pkg/errors" 24 | ) 25 | 26 | const ( 27 | addrsDeployedFile = "deployed-addrs.json" 28 | ) 29 | 30 | var ( 31 | checkHash = flag.String("check", "", "check the txn hash") 32 | checkAddrContract = flag.String("is_contract", "", "is it a contract") 33 | addrsDeployed = flag.String("addrs", addrsDeployedFile, "already deployed addrs") 34 | freshDeploy = flag.Bool("fresh", true, "fresh contract deployments") 35 | clientDial = flag.String( 36 | "client_dial", eth1, "could be websocket or IPC", 37 | ) 38 | 39 | deployerKey, _ = crypto.HexToECDSA( 40 | "7074988e20b9aa7c58ea6dd5a56aaf5faf4bedc2ea7da7b02adfc97c92b7ceb3", 41 | ) 42 | treasuryKey, _ = crypto.HexToECDSA( 43 | "0252d6c2476583794ac844385f63040d76f1904978a700e59a37c4e9f68c2f30", 44 | ) 45 | abiLido, _ = abi.JSON(strings.NewReader(string(lidoABI))) 46 | abiRegistry, _ = abi.JSON(strings.NewReader(string(nodeRegistryABI))) 47 | abiDepositContract, _ = abi.JSON(strings.NewReader(string(depositABI))) 48 | abiMEVLido, _ = abi.JSON(strings.NewReader(string(lidoMEVABI))) 49 | abiLightPrism, _ = abi.JSON(strings.NewReader(string(lightPrismABI))) 50 | ) 51 | 52 | func deployLidoContract( 53 | nonce uint64, 54 | from common.Address, 55 | client *ethclient.Client, 56 | chainID *big.Int, 57 | args []byte, 58 | ) (*types.Transaction, error) { 59 | 60 | payload := append(common.Hex2Bytes(lidoByteCode), args...) 61 | fmt.Println("using nonce ", nonce, "for lido deploy") 62 | t := types.NewContractCreation( 63 | nonce, new(big.Int), 400_0000, big.NewInt(10e9), payload, 64 | ) 65 | 66 | t, err := types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 67 | if err != nil { 68 | return nil, err 69 | } 70 | 71 | fmt.Println("deployed lido contract txn hash", t.Hash().Hex()) 72 | 73 | return t, client.SendTransaction(context.Background(), t) 74 | } 75 | 76 | func deployLightPrism( 77 | nonce uint64, 78 | from common.Address, 79 | client *ethclient.Client, 80 | chainID *big.Int, 81 | ) (*types.Transaction, error) { 82 | fmt.Println("using nonce", nonce, "for light prism deploy") 83 | 84 | t := types.NewContractCreation( 85 | nonce, new(big.Int), 4_000_000, big.NewInt(10e9), common.Hex2Bytes(lightPrismByteCode), 86 | ) 87 | 88 | t, err := types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 89 | if err != nil { 90 | return nil, err 91 | } 92 | 93 | fmt.Println("deployed light prism contract ", t.Hash().Hex()) 94 | time.Sleep(time.Second * 17) 95 | 96 | return t, client.SendTransaction(context.Background(), t) 97 | } 98 | 99 | func deployMEVDistributor( 100 | nonce uint64, 101 | from common.Address, 102 | client *ethclient.Client, 103 | chainID *big.Int, 104 | args []byte, 105 | ) (*types.Transaction, error) { 106 | 107 | payload := append(common.Hex2Bytes(lidoMEVdistribByteCode), args...) 108 | fmt.Println("using nonce", nonce, "for deply mev distributor") 109 | t := types.NewContractCreation( 110 | nonce, new(big.Int), 4_000_000, big.NewInt(10e9), payload, 111 | ) 112 | 113 | t, err := types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 114 | if err != nil { 115 | return nil, err 116 | } 117 | fmt.Println("deployed MEV distributor contract ", t.Hash().Hex()) 118 | return t, client.SendTransaction(context.Background(), t) 119 | } 120 | 121 | func contractDeploy( 122 | name string, 123 | nonce uint64, 124 | from common.Address, 125 | client *ethclient.Client, 126 | chainID *big.Int, 127 | rawByteCode []byte, 128 | ) (*types.Transaction, error) { 129 | 130 | fmt.Println("using nonce", nonce, "for contract deploy", name) 131 | t := types.NewContractCreation( 132 | nonce, new(big.Int), 400_000_0, big.NewInt(10e9), rawByteCode, 133 | ) 134 | 135 | t, err := types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 136 | if err != nil { 137 | return nil, err 138 | } 139 | fmt.Println("a generic contract deployed", t.Hash().Hex()) 140 | return t, client.SendTransaction(context.Background(), t) 141 | } 142 | 143 | var ( 144 | stakers []staker 145 | operators []common.Address 146 | ) 147 | 148 | func init() { 149 | rand.Seed(time.Now().UnixNano()) 150 | s1, _ := crypto.HexToECDSA( 151 | "98f6682f8e413e40bfe68e7551ea8c6d005f40aa520681f1dfccdf7238784113", 152 | ) 153 | s2, _ := crypto.HexToECDSA( 154 | "cc72af8c0acadaaabcbc1a485a4ea35380bb50633d36dd7dae57d99de9a5f639", 155 | ) 156 | s3, _ := crypto.HexToECDSA( 157 | "9e3dcc452413270fe82ac4e64e8cc989859b44a0caf00b336d6fcf7ff8d6dbd2", 158 | ) 159 | operators = []common.Address{ 160 | crypto.PubkeyToAddress(s1.PublicKey), 161 | crypto.PubkeyToAddress(s2.PublicKey), 162 | crypto.PubkeyToAddress(s3.PublicKey), 163 | } 164 | stakers = []staker{ 165 | {s1, big.NewInt(1e18)}, 166 | {s2, big.NewInt(1e18)}, 167 | {s3, big.NewInt(1e18)}, 168 | } 169 | } 170 | 171 | func addOperators( 172 | nonce_ uint64, 173 | client *ethclient.Client, 174 | registry common.Address, 175 | operators []common.Address, 176 | deployer common.Address, 177 | chainID *big.Int, 178 | ) (uint64, error) { 179 | 180 | nonce := nonce_ 181 | 182 | for i, oper := range operators { 183 | 184 | packed, err := abiRegistry.Pack("addNodeOperator", fmt.Sprintf("%d", i), oper, uint64(20)) 185 | if err != nil { 186 | return 0, err 187 | } 188 | 189 | nonce = nonce + uint64(i) 190 | 191 | t := types.NewTransaction( 192 | nonce, registry, new(big.Int), 500_000, big.NewInt(1e9), packed, 193 | ) 194 | t, err = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 195 | if err != nil { 196 | return 0, err 197 | } 198 | 199 | if err := client.SendTransaction(context.Background(), t); err != nil { 200 | return 0, err 201 | } 202 | 203 | pubKeys := make([]byte, 48*20) 204 | signatures := make([]byte, 96*20) 205 | rand.Read(pubKeys) 206 | rand.Read(signatures) 207 | 208 | packed, err = abiRegistry.Pack( 209 | "addSigningKeys", fmt.Sprintf("%d", i), 20, pubKeys, signatures, 210 | ) 211 | 212 | nonce++ 213 | 214 | t = types.NewTransaction( 215 | nonce, registry, new(big.Int), 200_000, big.NewInt(1e9), packed, 216 | ) 217 | 218 | t, err = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 219 | if err != nil { 220 | return 0, err 221 | } 222 | 223 | if err := client.SendTransaction(context.Background(), t); err != nil { 224 | return 0, err 225 | } 226 | 227 | } 228 | 229 | return nonce, nil 230 | } 231 | 232 | type staker struct { 233 | Key *ecdsa.PrivateKey 234 | Amt *big.Int 235 | } 236 | 237 | func stake( 238 | client *ethclient.Client, 239 | lido common.Address, 240 | stakers []staker, 241 | oracle common.Address, 242 | chainID *big.Int, 243 | deployer common.Address, 244 | ) error { 245 | 246 | for _, s := range stakers { 247 | nonce, err := client.NonceAt( 248 | context.Background(), 249 | crypto.PubkeyToAddress(s.Key.PublicKey), 250 | nil, 251 | ) 252 | if err != nil { 253 | return err 254 | } 255 | 256 | packed, err := abiLido.Pack("submit", common.Address{}) 257 | if err != nil { 258 | return err 259 | } 260 | t := types.NewTransaction( 261 | nonce, lido, s.Amt, 200_000, big.NewInt(1e9), packed, 262 | ) 263 | 264 | t, err = types.SignTx(t, types.NewEIP155Signer(chainID), s.Key) 265 | if err != nil { 266 | return err 267 | } 268 | 269 | if err := client.SendTransaction(context.Background(), t); err != nil { 270 | return err 271 | } 272 | } 273 | 274 | nonce, err := client.NonceAt( 275 | context.Background(), 276 | crypto.PubkeyToAddress(stakers[0].Key.PublicKey), nil, 277 | ) 278 | if err != nil { 279 | return err 280 | } 281 | 282 | packed, err := abiLido.Pack("depositBufferedEther", big.NewInt(9e18)) 283 | if err != nil { 284 | return err 285 | } 286 | t := types.NewTransaction( 287 | nonce, lido, new(big.Int), 200_000, big.NewInt(1e9), packed, 288 | ) 289 | 290 | t, err = types.SignTx(t, types.NewEIP155Signer(chainID), stakers[0].Key) 291 | if err != nil { 292 | return err 293 | } 294 | time.Sleep(time.Millisecond * 100) 295 | 296 | if err := client.SendTransaction(context.Background(), t); err != nil { 297 | fmt.Println("died here C") 298 | return err 299 | } 300 | 301 | // skip the getBeaconStat call, just hardcode call for pushBeacon 302 | 303 | raise := m.Exp(big.NewInt(10), big.NewInt(18)) 304 | stakerCount := big.NewInt(int64(len(stakers))) 305 | plusOne := new(big.Int).Add( 306 | new(big.Int).Mul(stakerCount, big.NewInt(32)), 307 | common.Big1, 308 | ) 309 | p := new(big.Int).Mul(plusOne, raise) 310 | packed, err = abiLido.Pack( 311 | "pushBeacon", 312 | stakerCount, 313 | p, 314 | ) 315 | 316 | if err != nil { 317 | return err 318 | } 319 | 320 | nonce, err = client.NonceAt( 321 | context.Background(), 322 | crypto.PubkeyToAddress(stakers[0].Key.PublicKey), 323 | nil, 324 | ) 325 | if err != nil { 326 | return err 327 | } 328 | 329 | t = types.NewTransaction( 330 | nonce, lido, new(big.Int), 200_000, big.NewInt(1e9), packed, 331 | ) 332 | 333 | time.Sleep(time.Millisecond * 100) 334 | t, err = types.SignTx(t, types.NewEIP155Signer(chainID), stakers[0].Key) 335 | 336 | if err != nil { 337 | return err 338 | } 339 | 340 | return client.SendTransaction(context.Background(), t) 341 | } 342 | 343 | const ( 344 | eth1 = "ws://138.68.75.41:8546/" 345 | eth2 = "ws://138.68.75.41:5051/" 346 | ) 347 | 348 | func program() error { 349 | client, err := ethclient.Dial(*clientDial) 350 | if err != nil { 351 | return err 352 | } 353 | 354 | type NeededAddrs struct { 355 | LightPrismAddr common.Address 356 | LidoContractAddr common.Address 357 | LidoMEVContractAddr common.Address 358 | DepositContractAddr common.Address 359 | NodeOperatorsRegistryAddr common.Address 360 | OracleAddr common.Address 361 | } 362 | 363 | var ( 364 | lightPrismAddr common.Address 365 | lidoContractAddr common.Address 366 | lidoMEVContractAddr common.Address 367 | depositContractAddr common.Address 368 | nodeOperatorsRegistryAddr common.Address 369 | deployerAddr = crypto.PubkeyToAddress(deployerKey.PublicKey) 370 | oracleAddr = deployerAddr 371 | treasuryAddr = crypto.PubkeyToAddress(treasuryKey.PublicKey) 372 | ) 373 | 374 | chainID, err := client.ChainID(context.Background()) 375 | networkID, _ := client.NetworkID(context.Background()) 376 | fmt.Println("using chain id", chainID, "networkID", networkID) 377 | 378 | if err != nil { 379 | return err 380 | } 381 | 382 | deployerBal, _ := client.BalanceAt(context.Background(), deployerAddr, nil) 383 | deployerNonce, _ := client.NonceAt(context.Background(), deployerAddr, nil) 384 | fmt.Println( 385 | "deployer addr", deployerAddr.Hex(), " has this much eth on hand\n", 386 | deployerBal, "\n", 387 | "and this nonce", deployerNonce, 388 | ) 389 | 390 | if a := *checkAddrContract; a != "" { 391 | bytes, err := client.CodeAt(context.Background(), common.HexToAddress(a), nil) 392 | if err != nil { 393 | return err 394 | } 395 | 396 | if bytes != nil { 397 | fmt.Println(common.HexToAddress(a).Hex(), "is a contract") 398 | } else { 399 | fmt.Println("not deployed as a contract") 400 | } 401 | return nil 402 | } 403 | 404 | if *checkHash != "" { 405 | 406 | recipt, err := client.TransactionReceipt( 407 | context.Background(), common.HexToHash(*checkHash), 408 | ) 409 | 410 | if err != nil { 411 | return err 412 | } 413 | 414 | fmt.Println("confirmed txn!", recipt) 415 | return nil 416 | } 417 | 418 | if *freshDeploy { 419 | 420 | currentBlock, err := client.BlockByNumber(context.Background(), nil) 421 | if err != nil { 422 | return err 423 | } 424 | 425 | fmt.Println("beginning deployment of contracts at live block number", 426 | currentBlock.Header().Number, 427 | ) 428 | 429 | nonce, err := client.NonceAt( 430 | context.Background(), deployerAddr, nil, 431 | ) 432 | 433 | t, err := contractDeploy( 434 | "deposit contract", 435 | nonce, 436 | deployerAddr, 437 | client, chainID, common.Hex2Bytes(depositContractByteCode), 438 | ) 439 | if err != nil { 440 | return errors.Wrapf(err, "deposit contract") 441 | } 442 | 443 | depositContractAddr = crypto.CreateAddress(deployerAddr, t.Nonce()) 444 | 445 | t, err = contractDeploy( 446 | "node operators registry ", 447 | nonce+1, 448 | deployerAddr, 449 | client, chainID, common.Hex2Bytes(nodeOperatorsRegistryByteCode), 450 | ) 451 | if err != nil { 452 | return errors.Wrapf(err, "node operators registry") 453 | } 454 | nodeOperatorsRegistryAddr = crypto.CreateAddress( 455 | deployerAddr, 456 | t.Nonce(), 457 | ) 458 | 459 | fmt.Println("deployed node operator registry at ", nodeOperatorsRegistryAddr.Hex()) 460 | packed, err := abiLido.Pack("", depositContractAddr, 461 | oracleAddr, 462 | nodeOperatorsRegistryAddr, 463 | treasuryAddr, 464 | treasuryAddr, 465 | ) 466 | 467 | if err != nil { 468 | return errors.Wrapf(err, "deposit contract addr") 469 | } 470 | 471 | t2, err := deployLidoContract( 472 | nonce+2, 473 | deployerAddr, client, chainID, packed, 474 | ) 475 | 476 | if err != nil { 477 | return errors.Wrapf(err, "deposit contract addr") 478 | } 479 | 480 | lidoContractAddr = crypto.CreateAddress(deployerAddr, t2.Nonce()) 481 | fmt.Println("deployed lido contract addr ", lidoContractAddr.Hex()) 482 | packed, err = abiRegistry.Pack("setLido", lidoContractAddr) 483 | if err != nil { 484 | return errors.Wrapf(err, "deposit contract addr") 485 | } 486 | t = types.NewTransaction( 487 | nonce+3, nodeOperatorsRegistryAddr, new(big.Int), 488 | 500_000, big.NewInt(1e9), packed, 489 | ) 490 | 491 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 492 | 493 | if err := client.SendTransaction(context.Background(), t); err != nil { 494 | return err 495 | } 496 | 497 | cred := [32]byte{} 498 | rand.Read(cred[:]) 499 | 500 | packed, err = abiLido.Pack("setWithdrawalCredentials", cred) 501 | t = types.NewTransaction( 502 | nonce+4, lidoContractAddr, new(big.Int), 503 | 200_000, big.NewInt(1e9), packed, 504 | ) 505 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 506 | 507 | if err := client.SendTransaction(context.Background(), t); err != nil { 508 | log.Fatal(err) 509 | } 510 | 511 | packed, err = abiLido.Pack("resume") 512 | if err != nil { 513 | log.Fatal(err) 514 | } 515 | nonce, err = client.NonceAt( 516 | context.Background(), deployerAddr, nil, 517 | ) 518 | t = types.NewTransaction( 519 | nonce+5, lidoContractAddr, new(big.Int), 520 | 200_000, big.NewInt(1e9), packed, 521 | ) 522 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 523 | 524 | if err := client.SendTransaction(context.Background(), t); err != nil { 525 | return err 526 | } 527 | 528 | packed, err = abiMEVLido.Pack( 529 | "", lidoContractAddr, new(big.Int).Mul(big.NewInt(5), big.NewInt(10e17)), 530 | ) 531 | 532 | if err != nil { 533 | return err 534 | } 535 | 536 | t, err = deployMEVDistributor( 537 | nonce+6, 538 | deployerAddr, client, chainID, packed, 539 | ) 540 | 541 | if err != nil { 542 | return err 543 | } 544 | 545 | lidoMEVContractAddr = crypto.CreateAddress(deployerAddr, t.Nonce()) 546 | fmt.Println("lidoMEV contract addr deployed at", lidoMEVContractAddr.Hex()) 547 | 548 | nonce, err = addOperators( 549 | nonce+7, client, nodeOperatorsRegistryAddr, 550 | operators, deployerAddr, chainID, 551 | ) 552 | 553 | if err != nil { 554 | return err 555 | } 556 | 557 | if err := stake( 558 | client, lidoContractAddr, stakers, oracleAddr, chainID, deployerAddr, 559 | ); err != nil { 560 | log.Fatal(err) 561 | } 562 | 563 | fmt.Println("Added operators & added stakers, deploying light prism") 564 | t, err = deployLightPrism(nonce+1, deployerAddr, client, chainID) 565 | if err != nil { 566 | return err 567 | } 568 | 569 | lightPrismAddr = crypto.CreateAddress( 570 | crypto.PubkeyToAddress(deployerKey.PublicKey), 571 | t.Nonce(), 572 | ) 573 | 574 | { 575 | packed, err := abiLightPrism.Pack("queueEther") 576 | if err != nil { 577 | return err 578 | } 579 | 580 | t = types.NewTransaction( 581 | nonce+2, lightPrismAddr, big.NewInt(3e18), 582 | 200_000, big.NewInt(1e9), packed, 583 | ) 584 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 585 | time.Sleep(time.Second * 17) 586 | if err := client.SendTransaction(context.Background(), t); err != nil { 587 | log.Fatal(err) 588 | } 589 | } 590 | 591 | packed, err = abiLightPrism.Pack( 592 | "setRecipients", common.Address{}, lidoContractAddr, 593 | ) 594 | if err != nil { 595 | return err 596 | } 597 | 598 | t = types.NewTransaction( 599 | nonce+3, lightPrismAddr, new(big.Int), 600 | 200_000, big.NewInt(1e9), packed, 601 | ) 602 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 603 | time.Sleep(time.Second * 17) 604 | 605 | if err := client.SendTransaction(context.Background(), t); err != nil { 606 | log.Fatal(err) 607 | } 608 | fmt.Println("set recipients worked") 609 | 610 | allAddrs := NeededAddrs{ 611 | LightPrismAddr: lightPrismAddr, 612 | LidoContractAddr: lidoContractAddr, 613 | LidoMEVContractAddr: lidoMEVContractAddr, 614 | DepositContractAddr: depositContractAddr, 615 | NodeOperatorsRegistryAddr: nodeOperatorsRegistryAddr, 616 | OracleAddr: deployerAddr, 617 | } 618 | s, _ := json.MarshalIndent(allAddrs, " ", " ") 619 | if err := ioutil.WriteFile(addrsDeployedFile, s, 0644); err != nil { 620 | fmt.Println("some problem on writing the file of nodes") 621 | } 622 | 623 | return nil 624 | } else { 625 | // not a fresh deployment - so lets 626 | var p NeededAddrs 627 | common.LoadJSON(addrsDeployedFile, &p) 628 | pret, _ := json.MarshalIndent(p, " ", " ") 629 | fmt.Println("Loaded up previously deployed addrs ", string(pret)) 630 | query := ethereum.FilterQuery{ 631 | Addresses: []common.Address{ 632 | p.LightPrismAddr, p.LidoContractAddr, p.LidoMEVContractAddr, 633 | p.DepositContractAddr, p.NodeOperatorsRegistryAddr, 634 | }, 635 | } 636 | 637 | logs := make(chan types.Log) 638 | sub, err := client.SubscribeFilterLogs(context.Background(), query, logs) 639 | if err != nil { 640 | return err 641 | } 642 | 643 | go func() { 644 | tick := time.NewTicker(time.Second * 10) 645 | for range tick.C { 646 | fmt.Println("Kicking off arbitrage txn") 647 | 648 | packedQueueEther, _ := abiLightPrism.Pack("queueEther") 649 | nonce, _ := client.NonceAt( 650 | context.Background(), deployerAddr, nil, 651 | ) 652 | packedQueueEther = nil 653 | 654 | t := types.NewTransaction( 655 | nonce, p.LightPrismAddr, big.NewInt(3e17), 656 | 200_000, big.NewInt(10e9), packedQueueEther, 657 | ) 658 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 659 | 660 | fmt.Println("packed queue ether", t.Hash().Hex()) 661 | 662 | if err := client.SendTransaction(context.Background(), t); err != nil { 663 | log.Fatal(err) 664 | } 665 | 666 | packedPayMiner, err := abiLightPrism.Pack("payMiner") 667 | if err != nil { 668 | log.Fatal(err) 669 | } 670 | 671 | { 672 | nonce, err = client.NonceAt( 673 | context.Background(), deployerAddr, nil, 674 | ) 675 | 676 | packedPayMiner = nil 677 | 678 | t = types.NewTransaction( 679 | nonce, p.LightPrismAddr, big.NewInt(1e18), 680 | 200_000, big.NewInt(10e9), packedPayMiner, 681 | ) 682 | 683 | t, _ = types.SignTx(t, types.NewEIP155Signer(chainID), deployerKey) 684 | 685 | pret, _ := json.MarshalIndent(t, " ", " ") 686 | 687 | fmt.Println( 688 | "packed payminer called txn hash:", 689 | t.Hash().Hex(), string(pret), 690 | ) 691 | 692 | if err := client.SendTransaction(context.Background(), t); err != nil { 693 | log.Fatal(err) 694 | } 695 | } 696 | 697 | fmt.Println("arbitrage round ended") 698 | } 699 | }() 700 | 701 | type PrismFlashbotsPayment struct { 702 | Coinbase common.Address 703 | ReceivingAddress common.Address 704 | MsgSender common.Address 705 | Amount *big.Int 706 | Raw types.Log // Blockchain specific contextual infos 707 | } 708 | 709 | type Recipients struct { 710 | Executor common.Address 711 | StakingPool common.Address 712 | } 713 | 714 | for { 715 | select { 716 | case err := <-sub.Err(): 717 | log.Fatal(err) 718 | case vLog := <-logs: 719 | event := new(PrismFlashbotsPayment) 720 | if err := abiLightPrism.UnpackIntoInterface( 721 | event, "FlashbotsPayment", vLog.Data, 722 | ); err != nil { 723 | fmt.Println("problem on unpacking inerface", err) 724 | } 725 | fmt.Println("did event", event) 726 | } 727 | } 728 | } 729 | 730 | return nil 731 | } 732 | 733 | func main() { 734 | flag.Parse() 735 | 736 | if err := program(); err != nil { 737 | log.Fatal(err) 738 | } 739 | } 740 | -------------------------------------------------------------------------------- /payments/migrations/1_migration.js: -------------------------------------------------------------------------------- 1 | const LightPrism = artifacts.require("LightPrism"); 2 | const LidoMevDistributor = artifacts.require("LidoMevDistributor"); 3 | // const NodeOperatorsRegistry = artifacts.require("NodeOperatorsRegistry"); 4 | // const DepositContractMock = artifacts.require("DepositContractMock"); 5 | // const Lido = artifacts.require("Lido"); 6 | 7 | module.exports = function (deployer) { 8 | // var operatorsAddress = deployer.deploy(NodeOperatorsRegistry); 9 | // var depositAddress = deployer.deploy(DepositContractMock); 10 | // var lidoAddress = deployer.deploy(Lido, 11 | // depositAddress, 12 | // `0x0000000000000000000000000000000000000001`, 13 | // operatorsAddress, 14 | // `0x0000000000000000000000000000000000000002`, 15 | // `0x0000000000000000000000000000000000000003`, 16 | // ); 17 | // var lidoAddress = '0x5304e3c2b42BEaA8f3e37585bFed1274D1055E47' 18 | // var address = deployer.deploy( 19 | // LidoMevDistributor, 20 | // lidoAddress, 21 | // `${1e18}` 22 | // ); 23 | // console.log(address); 24 | deployer.deploy(LightPrism); 25 | }; 26 | -------------------------------------------------------------------------------- /payments/mine.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function mine() { 4 | curl \ 5 | -X POST \ 6 | -H 'content-type:application/json' \ 7 | --data '{"id":1,"jsonrpc":"2.0","method":"evm_mine","params":[]}' \ 8 | 127.0.0.1:8545 9 | } 10 | 11 | mine 12 | -------------------------------------------------------------------------------- /payments/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@chainsafe/truffle-plugin-abigen": "^0.0.2", 4 | "@openzeppelin/contracts": "^3.4.0", 5 | "@truffle/hdwallet-provider": "1.0.44", 6 | "@uniswap/v2-core": "^1.0.1", 7 | "@uniswap/v2-periphery": "^1.1.0-beta.0", 8 | "bignumber.js": "^9.0.1", 9 | "eth-gas-reporter": "^0.2.21", 10 | "ethereumjs-tx": "^2.1.2", 11 | "node-fetch": "^2.6.1", 12 | "truffle-contract-size": "^2.0.1", 13 | "web3": "^1.3.4", 14 | "web3-provider-engine": "^15.0.12" 15 | }, 16 | "devDependencies": { 17 | "hardhat": "^2.0.11" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /payments/test/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flashbots/raytracing/7d95bc2d24aa6ee59e2fcbf2e33ad8418991968e/payments/test/.gitkeep -------------------------------------------------------------------------------- /payments/test/test.js: -------------------------------------------------------------------------------- 1 | const LightPrism = artifacts.require("LightPrism"); 2 | const LidoMevDistributor = artifacts.require("LidoMevDistributor"); 3 | const ERC20 = artifacts.require("IERC20"); 4 | const fetch = require("node-fetch"); 5 | const { Headers } = fetch; 6 | 7 | const headers = new Headers({ 8 | "content-type": "application/json", 9 | accept: "application/json", 10 | }); 11 | 12 | const nodeOperators = [ 13 | "0x15a2209CE319914B7E6e39FEF2d04A764e522f7E", 14 | "0xFA5B77d2b4A5071B6Da9D85787270260026d1042", 15 | "0x238F1b5Db4fC0Bff012278d59A1B60e915f55d40", 16 | ]; 17 | 18 | const stakers = [ 19 | "0x40acf4b2c6894aBBF880dbcb46791cE2bB273882", 20 | "0x14fe850e76Af0617eb5c01D525aB451ecc9f55eE", 21 | "0x5E90A2d51653CDc1Be80aAeF35Cd41F7cb34c3e4", 22 | ]; 23 | 24 | const send_bundle = async (url, txn) => { 25 | const resp = await fetch(url, { 26 | headers, 27 | body: JSON.stringify({ 28 | id: 1, 29 | jsonrpc: "2.0", 30 | method: "eth_sendBundle", 31 | params: [txn], 32 | }), 33 | }); 34 | 35 | const json = await resp.json(); 36 | return JSON.parse(json.result); 37 | }; 38 | 39 | // Traditional Truffle test 40 | contract("LightPrism", (accounts) => { 41 | it("Should pay", async function () { 42 | 43 | const lightPrism = await LightPrism.deployed(); 44 | const lidoDistr = await LidoMevDistributor.at("0x775A136c9bB5669677185dEEE09051A7382B1574"); 45 | const steth = await ERC20.at("0x218bC3c5AC79Ba91c8309D01f8D1466Db560dd23"); 46 | const executor = "0x3210000000000000000000000000000000000123"; 47 | const stakingPool = "0x775A136c9bB5669677185dEEE09051A7382B1574"; 48 | 49 | let drawBalances = async function() { 50 | await showBalance(lightPrism.address, "lightPrism "); 51 | await showBalance(executor, "coinbase "); 52 | await showBalance(stakingPool, "stakingPool"); 53 | draw____________________________________________(); 54 | }; 55 | 56 | let drawStaking = async function() { 57 | let opsBalances = await Promise.all( 58 | nodeOperators.map((op) => steth.balanceOf(op)) 59 | ); 60 | console.log( 61 | "node operators:", 62 | opsBalances.map((x) => x.toString()) 63 | ); 64 | let stakersBalances = await Promise.all( 65 | stakers.map((op) => steth.balanceOf(op)) 66 | ); 67 | console.log( 68 | "stakers: ", 69 | stakersBalances.map((x) => x.toString()) 70 | ); 71 | draw____________________________________________(); 72 | }; 73 | 74 | drawTitle("Presenting a Flashbots MEV-bundle (a list of transactions) sent to a Nethermind node. The bundle includes a transaction that sends an MEV tip to the LightPrism contract which then splits it between the coinbase (Eth1 node operator) and Lido staking pool (further distributing between stakers and validator nodes operators). The Eth1 block is generated in response to the assemble block call from an Eth2 client (Teku)."); 75 | console.log("MEV tip"); 76 | console.log("|"); 77 | console.log("|"); 78 | console.log("|"); 79 | console.log("_______1/3 to coinbase"); 80 | console.log("_______2/3 to staking pool"); 81 | console.log(" |"); 82 | console.log(" |"); 83 | console.log(" |"); 84 | console.log(" |"); 85 | console.log(" _______x% to validators"); 86 | console.log(" _______100% - x% to stakers"); 87 | draw____________________________________________(); 88 | console.log(""); 89 | 90 | drawTitle("Setting recipients of the MEV tip (this needs to be set only once by each coinbase)"); 91 | await lightPrism.setRecipients(executor, stakingPool); 92 | await waitForTx(); 93 | console.log(" coinbase <- " + executor); 94 | console.log(" stakingPool <- " + stakingPool); 95 | draw____________________________________________(); 96 | await drawBalances(); 97 | console.log(""); 98 | drawTitle("MEV bundle enqueues 0.001 ETH"); 99 | console.log(""); 100 | await lightPrism.queueEther({ value: 1000000000000000 }); 101 | await waitForTx(); 102 | // const recipients = { 103 | // executor: "0x0000000000000000000000000000000000000000", // zero will be coinbase 104 | // stakingPool: "0xabcd000000000000000000000000000000001234", // lidoDistr contract here 105 | // }; 106 | 107 | drawTitle("stETH balances before"); 108 | await drawBalances(); 109 | await drawStaking(); 110 | 111 | console.log(""); 112 | drawTitle("MEV bundle enqueues 0.001 ETH"); 113 | await lightPrism.queueEther({ value: 1000000000000000 }); 114 | await waitForTx(); 115 | await drawBalances(); 116 | console.log(""); 117 | drawTitle("MEV bundle makes a payment to a contract which splits it between the coinbase and the staking pool"); 118 | await lightPrism.payMiner(); 119 | await waitForTx(); 120 | await drawBalances(); 121 | console.log(""); 122 | drawTitle("Lido distributes MEV-tip between stakers and validator nodes operators"); 123 | await lidoDistr.distribureMev(); 124 | await waitForTx(); 125 | await drawBalances(); 126 | console.log(""); 127 | drawTitle("stETH balances after"); 128 | await drawStaking(); 129 | await drawBalances(); 130 | }); 131 | }); 132 | 133 | function drawTitle(titleText) { 134 | draw____________________________________________(); 135 | console.log(titleText); 136 | draw____________________________________________(); 137 | } 138 | 139 | function draw____________________________________________() { 140 | console.log("================================================================"); 141 | } 142 | 143 | async function waitForTx() { 144 | await new Promise(r => setTimeout(r, 500)); 145 | } 146 | 147 | async function showBalance(address, name) { 148 | let balance = await web3.eth.getBalance(address); 149 | console.log(`${name}: `, balance); 150 | } 151 | 152 | -------------------------------------------------------------------------------- /payments/truffle-config.js: -------------------------------------------------------------------------------- 1 | var HDWalletProvider = require("@truffle/hdwallet-provider"); 2 | const fs = require("fs"); 3 | 4 | module.exports = { 5 | networks: { 6 | mainnet: { 7 | provider: () => { 8 | return new HDWalletProvider( 9 | "7074988e20b9aa7c58ea6dd5a56aaf5faf4bedc2ea7da7b02adfc97c92b7ceb3", 10 | "http://138.68.75.41:8545" 11 | ); 12 | }, 13 | from: "0x756AC76D26f4c9055999C027eE2069ae77107A32", 14 | network_id: 700, 15 | chain_id: 700, 16 | chainId: 700, 17 | chainID: 700, 18 | gas: 5241313, 19 | gasPrice: 60000000000, //134 gwei 20 | confirmations: 0, 21 | timeoutBlocks: 10, 22 | skipDryRun: true, 23 | }, 24 | }, 25 | mocha: {}, 26 | compilers: { 27 | solc: { 28 | version: "0.8.4", // Fetch exact version from solc-bin (default: truffle's version) 29 | }, 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /payments/watch_for_arb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flashbots/raytracing/7d95bc2d24aa6ee59e2fcbf2e33ad8418991968e/payments/watch_for_arb --------------------------------------------------------------------------------