diff --git a/test/TestRelayerBalance.sol b/test/TestRelayerBalance.sol new file mode 100644 index 0000000..b5d3ba7 --- /dev/null +++ b/test/TestRelayerBalance.sol @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.6.12; +pragma experimental ABIEncoderV2; + +import { console2 } from "@forge-std/console2.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +import { MockProposal } from "./MockProposal.sol"; +import { RelayerRegistry } from "@root/v4-patch/RelayerRegistry.sol"; + +contract TestRelayerBalance is MockProposal { + address[] internal allRelayersAddresses = [ + 0x20BB3095a4852F4c97d7A188E9f7183C85AcfC49, + 0x47b03dF2145CC9Eed6d8819E02D25590F297C603, + 0xBe4d1e137A24af091be80Ae58d652279665e3A27, + 0x18F516dD6D5F46b2875Fd822B994081274be2a8b, + 0x49136693081f2c18E2cF14428dD78cd90A22dC1f, + 0xA0F0287683E820FF4211e67C03cf46a87431f4E1, + 0xD6187b4a0f51355A36764558D39b2C21aC12393D, + 0x2ca1a9D6c79367EA1eA481FC0A5e8C5BD6C62d25, + 0x9f9f98e28456EEEFC4Af1c990a170e2B0D2d6027, + 0xb326d1F0837E14Ad265397800eF3Bf7a538335E4, + 0xB5cD48dD89C063B5a3Fe1BCC325364be62fc0f00, + 0x0F75C6BFAF436Eba0cB977Dcdfb0F30b57ff9D05, + 0x6a2D058890ccA15BEaEe5050caaAd56B2aB54DD4, + 0x62E142F218585827436f59997C301F7040396AD4, + 0x85972458dfBf9269567b2a27C4ffC958A4f24761, + 0x078AD5DB2151083Ec16eCA1b26e2C98f79034DA8, + 0x3514Cfd42E4DDe9E65e283EbdBfa2888117823A6, + 0x550c9288310482F593602dD3e426603ae00BC352, + 0x3884e9b1E2b0f8D00666c9767B5602B709EeEE06, + 0xc6C86Aa348Eaa0ef1b6F8Da90C279b670e67A55D, + 0x9f340Bf3791809293DC50321Bd7F4c19120a98B6, + 0xF6CB46F9c2E34cD4B7f374D225e0aE5F474DdB32, + 0x076D4E32C6A5D888fC4658281539c94E778C796d, + 0x28907F21F43B419F34226d6f10aCbCf1832b1D4d, + 0x6289C8a70EE2Ed6914834CaEa431F9a82c7eAf70, + 0xE6B23CBae6a62f4b52A021B76E7811522eb82055, + 0xAF02873D7dF5f3e6D5fF42F622F4e138A68208e7, + 0xb9C612760dC5456e5979393Cfe4AB1fF270AE9e5, + 0xa56963fe9F46C758B2D0616A754346A8F9eba30b, + 0x56be1F8196cC4AefCe3348E679a2008496D14473, + 0x63606C4011e97a73BCd844Cde6a38D45a728BC0E, + 0xE939c61Acd8bD30366435C6B1033251117851b03, + 0x3e9979106DA74AFB64b866218AeB47F224A312bb, + 0x28f1a9b8e3941C0909059eB84E5834154A99E0fC, + 0x9c8C81f3F5C19DFfeE7257Dd7477b8ef6E405e82, + 0x644D4f3b293a7fc86eB4EFB6Bd2439f7603C991D, + 0x25De357c61c9f2711A605b66E83887BA5Fd22ac1, + 0x78c88fF43cd503316e8A15B6d92b2EBFa73802B2, + 0x2C42550Ff1Bdc139b54C5042a9a86A56398E9d83, + 0xf18673Ab6Eb72937607aA8388b8f7aa0AC3a0D32, + 0x3a1d526D09b7E59Fd88De4726f68A8246dDC2742, + 0x7Ba6781620c91676B070D319E7E894BFd4A9eC81, + 0x9Ffbd3f9eE795A4fDa880ED553A2A4BD6D45CE5B, + 0xe6184DA55174Cc0263a17eA2fc24E48511766505, + 0x36989535F0290eaC96692675cbf15a3BD2f42E46, + 0x12D92FeD171F16B3a05ACB1542B40648E7CEd384, + 0x08657a1f4C1F06d657F31767831421EE7FaDf549, + 0x42FecB4137aFF76E0E85702ff4F339DbFe6D859E, + 0xc6e531CF18afE3a64bE19e40ac410f39FC9738da, + 0x9Ee26a4bFd731E8e742B65bF955814EADdd7F151, + 0x7E3893725d4e238B4c8c83375bBAd024a66Ffa42, + 0x465403d43f48Dfaa3F9385B60F0fEa36c360C18A, + 0xc7285e85a6D11C762A7D9C57aC38E31A671E9777, + 0x74b6ea6B2EeFd3eF4da5E8c4C0480776035029c2, + 0x14812AE927e2BA5aA0c0f3C0eA016b3039574242, + 0xdc957b6a3F630bEf2E6104C1a22dAeF9650b5349, + 0x1247749d7E28D357B4279110af0802603AC526cE, + 0x1036AF02bCDb2e3A4db2d3D40b29e5054EDc79BA, + 0x3665B1E938Ce90c48502303ACB5049Fb065D3a85, + 0x87BeDf6AD81A2907633Ab68D02c44f0415bc68C1, + 0x0B45840cCEE39aeEfFDF621633d24AA8930B834c, + 0xcBD78860218160F4b463612f30806807Fe6E804C, + 0xa42303EE9B2eC1DB7E2a86Ed6C24AF7E49E9e8B9, + 0xa0109274F53609f6Be97ec5f3052C659AB80f012, + 0xb578603D3fB9216158c29488c1A902Dd0300c115, + 0x7b81b8680b1abd1e2E983a1589DeB5468B50A544, + 0x4750BCfcC340AA4B31be7e71fa072716d28c29C5, + 0x36DD7b862746fdD3eDd3577c8411f1B76FDC2Af5, + 0x0D13F55BA1509352F9e36190d948D7c45B854Be2, + 0x4803c6ec3E61cD1bb1735bBDdB21732100AA13cc, + 0x1ee815AD4a914c2C2f4650b3ED34978F8Fe2fcC4, + 0x04843E2C74018c8d94f1834a7ccB94c16691E451, + 0x0000208a6cC0299dA631C08fE8c2EDe435Ea83B8, + 0x853281B7676DFB66B87e2f26c9cB9D10Ce883F37, + 0xaaaaD0b504B4CD22348C4Db1071736646Aa314C6, + 0x5a0cB6505B3b99dD4035bb1Ac43cC51202d4e29F, + 0x7171717171866B60cc1A76A058ae20C8F703AE05, + 0x30F96AEF199B399B722F8819c9b0723016CEAe6C, + 0xEFa22d23de9f293B11e0c4aC865d7b440647587a, + 0xC0F12799B8D3FA8810DfE1616095170C72117F8F, + 0x996ad81FD83eD7A87FD3D03694115dff19db0B3b, + 0x000000Cd6521Ed1a65FAe0678eA15aF4EEAD74fe, + 0x15980A3Bd6ed317f42d2eD0DCf3d3D730b6Bc0C5, + 0x7853E027F37830790685622cdd8685fF0c8255A2, + 0xf0D9b969925116074eF43e7887Bcf035Ff1e7B19, + 0x97096F56B09F6aaA4230eec3BA33249995690B0E, + 0x5555555731006f71f121144534Ca7C8799F66AA3, + 0x5007565e69E5c23C278c2e976beff38eF4D27B3d, + 0x2ffAc4D796261ba8964d859867592B952b9FC158, + 0xCEdac436cEA98E93F471331eCC693fF41D730921, + 0x94596B6A626392F5D972D6CC4D929a42c2f0008c, + 0x065f2A0eF62878e8951af3c387E4ddC944f1B8F4, + 0xe7c490986FC34248F77b813eD6C8971e76e0384C, + 0xC49415493eB3Ec64a0F13D8AA5056f1CfC4ce35c + ]; + + function testRelayerBalancesSum() public view { + RelayerRegistry registry = RelayerRegistry(getRelayerRegistryProxyAddress()); + uint256 relayersBalancesSum; + + for (uint256 i = 0; i < allRelayersAddresses.length; i++) { + uint256 currentRelayerBalance = registry.getRelayerBalance(allRelayersAddresses[i]); + relayersBalancesSum += currentRelayerBalance; + console2.log("Relayer %s, relayer balance: %s TORN", allRelayersAddresses[i], currentRelayerBalance / 10e17); + } + + console2.log("\nSum of relayer balances on block %s: %s TORN", block.number, relayersBalancesSum / 10e17); + + require(relayersBalancesSum > 0); + } +}