diff --git a/backend/examples/summa_solvency_flow.rs b/backend/examples/summa_solvency_flow.rs index f994b61f..8fa58c1b 100644 --- a/backend/examples/summa_solvency_flow.rs +++ b/backend/examples/summa_solvency_flow.rs @@ -25,7 +25,7 @@ use summa_solvency::{ const K: u32 = 17; const N_CURRENCIES: usize = 2; -const N_POINTS: usize = 3; +const N_POINTS: usize = N_CURRENCIES + 1; const N_USERS: usize = 16; const USER_INDEX: usize = 0; @@ -128,7 +128,7 @@ async fn main() -> Result<(), Box> { // 4. Verify Inclusion Proof // - // The `snapshot_time` denotes the specific moment when entries were created for polynomal encoding. + // The `snapshot_time` denotes the specific moment when entries were created for polynomal interpolation. // This timestamp is established during the initialization of the Round instance. let snapshot_time = U256::from(timestamp); diff --git a/backend/src/contracts/abi/Summa.json b/backend/src/contracts/abi/Summa.json index 15a355ce..2eba6da3 100644 --- a/backend/src/contracts/abi/Summa.json +++ b/backend/src/contracts/abi/Summa.json @@ -1 +1 @@ -{"_format":"hh-sol-artifact-1","contractName":"Summa","sourceName":"src/Summa.sol","abi":[{"inputs":[{"internalType":"address","name":"_verifyingKey","type":"address"},{"internalType":"contract IVerifier","name":"_polynomialEncodingVerifier","type":"address"},{"internalType":"contract IVerifier","name":"_grandSumVerifier","type":"address"},{"internalType":"contract IInclusionVerifier","name":"_inclusionVerifier","type":"address"},{"internalType":"string[]","name":"cryptocurrencyNames","type":"string[]"},{"internalType":"string[]","name":"cryptocurrencyChains","type":"string[]"},{"internalType":"uint8","name":"balanceByteRange","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"components":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"indexed":false,"internalType":"struct Summa.AddressOwnershipProof[]","name":"addressOwnershipProofs","type":"tuple[]"}],"name":"AddressOwnershipProofSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"totalBalances","type":"uint256[]"},{"indexed":false,"internalType":"bytes","name":"snarkProof","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"grandSumProof","type":"bytes"}],"name":"LiabilitiesCommitmentSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"addressOwnershipProofs","outputs":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"commitments","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint8","name":"balanceByteRange","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"addressHash","type":"bytes32"}],"name":"getAddressOwnershipProof","outputs":[{"components":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"internalType":"struct Summa.AddressOwnershipProof","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"snarkProof","type":"bytes"},{"internalType":"bytes","name":"grandSumProof","type":"bytes"},{"internalType":"uint256[]","name":"totalBalances","type":"uint256[]"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"submitCommitment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"internalType":"struct Summa.AddressOwnershipProof[]","name":"_addressOwnershipProofs","type":"tuple[]"}],"name":"submitProofOfAddressOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"inclusionProof","type":"bytes"},{"internalType":"uint256[]","name":"challenges","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"verifyInclusionProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifyingKey","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"bytecode":"0x6101006040523480156200001257600080fd5b50604051620028f0380380620028f083398101604081905262000035916200074b565b620000403362000425565b6001600160a01b0387166200009c5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420766572696679696e67206b6579206164647265737300000060448201526064015b60405180910390fd5b6001600160a01b0387166080528151835114620001145760405162461bcd60e51b815260206004820152602f60248201527f43727970746f63757272656e6379206e616d657320616e6420636861696e732060448201526e0dceadac4cae440dad2e6dac2e8c6d608b1b606482015260840162000093565b60005b8351811015620001d15783818151811062000136576200013662000827565b6020026020010151516000141580156200016e575082818151811062000160576200016062000827565b602002602001015151600014155b620001bc5760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642063727970746f63757272656e637900000000000000000000604482015260640162000093565b80620001c88162000853565b91505062000117565b50620001e6878451836200047560201b60201c565b6200025a5760405162461bcd60e51b815260206004820152603c60248201527f54686520636f6e66696720706172616d657465727320646f206e6f7420636f7260448201527f726573706f6e6420746f2074686520766572696679696e67206b657900000000606482015260840162000093565b6001600160a01b038616620002c75760405162461bcd60e51b815260206004820152602c60248201527f496e76616c696420706f6c796e6f6d69616c20656e636f64696e67207665726960448201526b66696572206164647265737360a01b606482015260840162000093565b6001600160a01b0380871660a0528516620003305760405162461bcd60e51b815260206004820152602260248201527f496e76616c6964206772616e642073756d207665726966696572206164647265604482015261737360f01b606482015260840162000093565b6001600160a01b0380861660c0528416620003995760405162461bcd60e51b815260206004820152602260248201527f496e76616c696420696e636c7573696f6e207665726966696572206164647265604482015261737360f01b606482015260840162000093565b6001600160a01b03841660e05260408051606081018252848152602080820185905260ff84169282019290925284519091600191620003de91839190880190620004f7565b506020828101518051620003f99260018501920190620004f7565b50604091909101516002909101805460ff191660ff9092169190911790555062000a4795505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083620004866002856200086f565b60ff16620004959190620008a0565b620004a2906002620008c0565b90506102e06000620004b6836040620008a0565b620004c29083620008c0565b90506000620004d3601083620008d6565b9050600060208260008b3c5050600051600f81161590151916979650505050505050565b82805482825590600052602060002090810192821562000542579160200282015b828111156200054257825182906200053190826200097b565b509160200191906001019062000518565b506200055092915062000554565b5090565b80821115620005505760006200056b828262000575565b5060010162000554565b5080546200058390620008ec565b6000825580601f1062000594575050565b601f016020900490600052602060002090810190620005b49190620005b7565b50565b5b80821115620005505760008155600101620005b8565b6001600160a01b0381168114620005b457600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620006255762000625620005e4565b604052919050565b6000601f83818401126200064057600080fd5b825160206001600160401b03808311156200065f576200065f620005e4565b8260051b62000670838201620005fa565b93845286810183019383810190898611156200068b57600080fd5b84890192505b858310156200073e57825184811115620006ab5760008081fd5b8901603f81018b13620006be5760008081fd5b8581015185811115620006d557620006d5620005e4565b620006e8818a01601f19168801620005fa565b81815260408d81848601011115620007005760008081fd5b60005b8381101562000720578481018201518382018b0152890162000703565b50506000918101880191909152835250918401919084019062000691565b9998505050505050505050565b600080600080600080600060e0888a0312156200076757600080fd5b87516200077481620005ce565b60208901519097506200078781620005ce565b60408901519096506200079a81620005ce565b6060890151909550620007ad81620005ce565b60808901519094506001600160401b0380821115620007cb57600080fd5b620007d98b838c016200062d565b945060a08a0151915080821115620007f057600080fd5b50620007ff8a828b016200062d565b92505060c088015160ff811681146200081757600080fd5b8091505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200086857620008686200083d565b5060010190565b600060ff8316806200089157634e487b7160e01b600052601260045260246000fd5b8060ff84160491505092915050565b8082028115828204841417620008ba57620008ba6200083d565b92915050565b80820180821115620008ba57620008ba6200083d565b81810381811115620008ba57620008ba6200083d565b600181811c908216806200090157607f821691505b6020821081036200092257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200097657600081815260208120601f850160051c81016020861015620009515750805b601f850160051c820191505b8181101562000972578281556001016200095d565b5050505b505050565b81516001600160401b03811115620009975762000997620005e4565b620009af81620009a88454620008ec565b8462000928565b602080601f831160018114620009e75760008415620009ce5750858301515b600019600386901b1c1916600185901b17855562000972565b600085815260208120601f198616915b8281101562000a1857888601518255948401946001909101908401620009f7565b508582101562000a375787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e051611e5a62000a966000396000610cb801526000610514015260006103500152600081816101380152818161037d015281816105410152610ce50152611e5a6000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637950c5f8116100715780637950c5f8146101335780638da5cb5b146101725780639c38255914610183578063a3c4bcf8146101a6578063c7ddca0e146101c9578063f2fde38b146101dc57600080fd5b806305ab9860146100ae57806319b33968146100c357806349ce8997146100ec578063715018a61461010c57806379502c5514610114575b600080fd5b6100c16100bc3660046114cb565b6101ef565b005b6100d66100d1366004611567565b610660565b6040516100e3919061163b565b60405180910390f35b6100ff6100fa366004611567565b610973565b6040516100e39190611655565b6100c1610a0d565b6003546101219060ff1681565b60405160ff90911681526020016100e3565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100e3565b6000546001600160a01b031661015a565b6101966101913660046116d8565b610a21565b60405190151581526020016100e3565b6101b96101b4366004611567565b610d5f565b6040516100e3949392919061176a565b6100c16101d73660046117b7565b610fbf565b6100c16101ea366004611911565b611260565b6101f76112d9565b600082511161024d5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420746f74616c2062616c616e636573206c656e67746800000060448201526064015b60405180910390fd5b815161025a906040611950565b83146102a85760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964206772616e642073756d2070726f6f66206c656e67746800006044820152606401610244565b8285116102f75760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736e61726b2070726f6f66206c656e6774680000000000006044820152606401610244565b6040805160018082528183019092526000916020808301908036833701905050905060018160008151811061032e5761032e61196d565b602090810291909101015260405163af83a18d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d906103ab907f0000000000000000000000000000000000000000000000000000000000000000908b908b9087906004016119e7565b602060405180830381865afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec9190611a1e565b61042e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21039b730b93590383937b7b360691b6044820152606401610244565b6001548351146104a65760405162461bcd60e51b815260206004820152603a60248201527f4c696162696c69747920636f6d6d69746d656e747320616e642063727970746f60448201527f63757272656e63696573206e756d626572206d69736d617463680000000000006064820152608401610244565b3660008881896104b7896040611a40565b926104c493929190611a53565b9092509050600087876104da8460408188611a53565b6040516020016104ed9493929190611a7d565b60408051601f198184030181529082905263af83a18d60e01b825291506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d9061056d907f00000000000000000000000000000000000000000000000000000000000000009085908b90600401611a9f565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611a1e565b6105fa5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206772616e642073756d2070726f6f660000000000000000006044820152606401610244565b6000858152600560205260409020610613838583611b68565b50847f7603a12a8838a565715ddb5bbf625b3f00a5e6f4793437537963e30c3b9495dc8785858c8c60405161064c959493929190611c29565b60405180910390a250505050505050505050565b61068b6040518060800160405280606081526020016060815260200160608152602001606081525090565b6000828152600660205260409020546106dd5760405162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b6044820152606401610244565b6000828152600660205260409020546004906106fb90600190611c70565b8154811061070b5761070b61196d565b906000526020600020906004020160405180608001604052908160008201805461073490611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611adf565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b505050505081526020016001820180546107c690611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546107f290611adf565b801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b5050505050815260200160028201805461085890611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461088490611adf565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020016003820180546108ea90611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461091690611adf565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050815250509050919050565b6005602052600090815260409020805461098c90611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890611adf565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b610a156112d9565b610a1f6000611333565b565b60008251600414610a745760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206368616c6c656e676573206c656e677468000000000000006044820152606401610244565b6001805483519091610a8591611c70565b14610add5760405162461bcd60e51b815260206004820152602260248201527f56616c756573206c656e677468206d69736d61746368207769746820636f6e66604482015261696760f01b6064820152608401610244565b60008581526005602052604081208054610af690611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290611adf565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b50505050509050600085518251610b869190611a40565b67ffffffffffffffff811115610b9e57610b9e6113cc565b6040519080825280601f01601f191660200182016040528015610bc8576020820181803683370190505b50905060005b8651811015610c2f57868181518110610be957610be961196d565b602001015160f81c60f81b828281518110610c0657610c0661196d565b60200101906001600160f81b031916908160001a90535080610c2781611c83565b915050610bce565b5060005b8251811015610ca057828181518110610c4e57610c4e61196d565b602001015160f81c60f81b82885183610c679190611a40565b81518110610c7757610c7761196d565b60200101906001600160f81b031916908160001a90535080610c9881611c83565b915050610c33565b506040516323fb5ad560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906347f6b5aa90610d13907f00000000000000000000000000000000000000000000000000000000000000009085908a908a90600401611c9c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d549190611a1e565b979650505050505050565b60048181548110610d6f57600080fd5b9060005260206000209060040201600091509050806000018054610d9290611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610dbe90611adf565b8015610e0b5780601f10610de057610100808354040283529160200191610e0b565b820191906000526020600020905b815481529060010190602001808311610dee57829003601f168201915b505050505090806001018054610e2090611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c90611adf565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b505050505090806002018054610eae90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90611adf565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b505050505090806003018054610f3c90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6890611adf565b8015610fb55780601f10610f8a57610100808354040283529160200191610fb5565b820191906000526020600020905b815481529060010190602001808311610f9857829003601f168201915b5050505050905084565b610fc76112d9565b60005b8151811015611225576000828281518110610fe757610fe761196d565b6020026020010151600001516040516020016110039190611ce6565b60408051601f1981840301815291815281516020928301206000818152600690935291205490915080156110795760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920766572696669656400000000000000006044820152606401610244565b600484848151811061108d5761108d61196d565b602090810291909101810151825460018101845560009384529190922082516004909202019081906110bf9082611d02565b50602082015160018201906110d49082611d02565b50604082015160028201906110e99082611d02565b50606082015160038201906110fe9082611d02565b50506004546000848152600660205260409020555083518490849081106111275761112761196d565b6020026020010151600001515160001415801561116357508383815181106111515761115161196d565b60200260200101516020015151600014155b801561118e575083838151811061117c5761117c61196d565b60200260200101516040015151600014155b80156111b957508383815181106111a7576111a761196d565b60200260200101516060015151600014155b6112105760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642070726f6f66206f662061646472657373206f776e65727368604482015261069760f41b6064820152608401610244565b5050808061121d90611c83565b915050610fca565b507f382315d4d56a6035e1899bffe77d9becefaf5f2650e4323b27854857a0454658816040516112559190611dc2565b60405180910390a150565b6112686112d9565b6001600160a01b0381166112cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610244565b6112d681611333565b50565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610244565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261139557600080fd5b50813567ffffffffffffffff8111156113ad57600080fd5b6020830191508360208285010111156113c557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611405576114056113cc565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611434576114346113cc565b604052919050565b600067ffffffffffffffff821115611456576114566113cc565b5060051b60200190565b600082601f83011261147157600080fd5b813560206114866114818361143c565b61140b565b82815260059290921b840181019181810190868411156114a557600080fd5b8286015b848110156114c057803583529183019183016114a9565b509695505050505050565b600080600080600080608087890312156114e457600080fd5b863567ffffffffffffffff808211156114fc57600080fd5b6115088a838b01611383565b9098509650602089013591508082111561152157600080fd5b61152d8a838b01611383565b9096509450604089013591508082111561154657600080fd5b5061155389828a01611460565b925050606087013590509295509295509295565b60006020828403121561157957600080fd5b5035919050565b60005b8381101561159b578181015183820152602001611583565b50506000910152565b600081518084526115bc816020860160208601611580565b601f01601f19169290920160200192915050565b60008151608084526115e560808501826115a4565b9050602083015184820360208601526115fe82826115a4565b9150506040830151848203604086015261161882826115a4565b9150506060830151848203606086015261163282826115a4565b95945050505050565b60208152600061164e60208301846115d0565b9392505050565b60208152600061164e60208301846115a4565b600082601f83011261167957600080fd5b813567ffffffffffffffff811115611693576116936113cc565b6116a6601f8201601f191660200161140b565b8181528460208386010111156116bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156116ee57600080fd5b84359350602085013567ffffffffffffffff8082111561170d57600080fd5b61171988838901611668565b9450604087013591508082111561172f57600080fd5b61173b88838901611460565b9350606087013591508082111561175157600080fd5b5061175e87828801611460565b91505092959194509250565b60808152600061177d60808301876115a4565b828103602084015261178f81876115a4565b905082810360408401526117a381866115a4565b90508281036060840152610d5481856115a4565b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b81356118046114818261143c565b81815260059190911b8301840190848101908883111561182357600080fd5b8585015b838110156119045780358581111561183e57600080fd5b86016080818c03601f190112156118555760008081fd5b61185d6113e2565b888201358781111561186f5760008081fd5b61187d8d8b83860101611668565b825250604080830135888111156118945760008081fd5b6118a28e8c83870101611668565b8b84015250606080840135898111156118bb5760008081fd5b6118c98f8d83880101611668565b838501525060808401359150888211156118e35760008081fd5b6118f18e8c84870101611668565b9083015250845250918601918601611827565b5098975050505050505050565b60006020828403121561192357600080fd5b81356001600160a01b038116811461164e57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176119675761196761193a565b92915050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526020808501945080840160005b838110156119dc578151875295820195908201906001016119c0565b509495945050505050565b6001600160a01b0385168152606060208201819052600090611a0c9083018587611983565b8281036040840152610d5481856119ac565b600060208284031215611a3057600080fd5b8151801515811461164e57600080fd5b808201808211156119675761196761193a565b60008085851115611a6357600080fd5b83861115611a7057600080fd5b5050820193919092039150565b8385823760008482016000815283858237600093019283525090949350505050565b6001600160a01b0384168152606060208201819052600090611ac3908301856115a4565b8281036040840152611ad581856119ac565b9695505050505050565b600181811c90821680611af357607f821691505b602082108103611b1357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b6357600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b5050505b505050565b67ffffffffffffffff831115611b8057611b806113cc565b611b9483611b8e8354611adf565b83611b19565b6000601f841160018114611bc85760008515611bb05750838201355b600019600387901b1c1916600186901b178355611c22565b600083815260209020601f19861690835b82811015611bf95786850135825560209485019460019092019101611bd9565b5086821015611c165760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b606081526000611c3c60608301886119ac565b8281036020840152611c4f818789611983565b90508281036040840152611c64818587611983565b98975050505050505050565b818103818111156119675761196761193a565b600060018201611c9557611c9561193a565b5060010190565b6001600160a01b0385168152608060208201819052600090611cc0908301866115a4565b8281036040840152611cd281866119ac565b90508281036060840152610d5481856119ac565b60008251611cf8818460208701611580565b9190910192915050565b815167ffffffffffffffff811115611d1c57611d1c6113cc565b611d3081611d2a8454611adf565b84611b19565b602080601f831160018114611d655760008415611d4d5750858301515b600019600386901b1c1916600185901b178555611b5f565b600085815260208120601f198616915b82811015611d9457888601518255948401946001909101908401611d75565b5085821015611db25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611e1757603f19888603018452611e058583516115d0565b94509285019290850190600101611de9565b509297965050505050505056fea264697066735822122086b05c81b0f60b1a31ee68c4dd52ab17db71abf49d4386d873f88ee7e492e86a64736f6c63430008120033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80637950c5f8116100715780637950c5f8146101335780638da5cb5b146101725780639c38255914610183578063a3c4bcf8146101a6578063c7ddca0e146101c9578063f2fde38b146101dc57600080fd5b806305ab9860146100ae57806319b33968146100c357806349ce8997146100ec578063715018a61461010c57806379502c5514610114575b600080fd5b6100c16100bc3660046114cb565b6101ef565b005b6100d66100d1366004611567565b610660565b6040516100e3919061163b565b60405180910390f35b6100ff6100fa366004611567565b610973565b6040516100e39190611655565b6100c1610a0d565b6003546101219060ff1681565b60405160ff90911681526020016100e3565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100e3565b6000546001600160a01b031661015a565b6101966101913660046116d8565b610a21565b60405190151581526020016100e3565b6101b96101b4366004611567565b610d5f565b6040516100e3949392919061176a565b6100c16101d73660046117b7565b610fbf565b6100c16101ea366004611911565b611260565b6101f76112d9565b600082511161024d5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420746f74616c2062616c616e636573206c656e67746800000060448201526064015b60405180910390fd5b815161025a906040611950565b83146102a85760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964206772616e642073756d2070726f6f66206c656e67746800006044820152606401610244565b8285116102f75760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736e61726b2070726f6f66206c656e6774680000000000006044820152606401610244565b6040805160018082528183019092526000916020808301908036833701905050905060018160008151811061032e5761032e61196d565b602090810291909101015260405163af83a18d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d906103ab907f0000000000000000000000000000000000000000000000000000000000000000908b908b9087906004016119e7565b602060405180830381865afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec9190611a1e565b61042e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21039b730b93590383937b7b360691b6044820152606401610244565b6001548351146104a65760405162461bcd60e51b815260206004820152603a60248201527f4c696162696c69747920636f6d6d69746d656e747320616e642063727970746f60448201527f63757272656e63696573206e756d626572206d69736d617463680000000000006064820152608401610244565b3660008881896104b7896040611a40565b926104c493929190611a53565b9092509050600087876104da8460408188611a53565b6040516020016104ed9493929190611a7d565b60408051601f198184030181529082905263af83a18d60e01b825291506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d9061056d907f00000000000000000000000000000000000000000000000000000000000000009085908b90600401611a9f565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611a1e565b6105fa5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206772616e642073756d2070726f6f660000000000000000006044820152606401610244565b6000858152600560205260409020610613838583611b68565b50847f7603a12a8838a565715ddb5bbf625b3f00a5e6f4793437537963e30c3b9495dc8785858c8c60405161064c959493929190611c29565b60405180910390a250505050505050505050565b61068b6040518060800160405280606081526020016060815260200160608152602001606081525090565b6000828152600660205260409020546106dd5760405162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b6044820152606401610244565b6000828152600660205260409020546004906106fb90600190611c70565b8154811061070b5761070b61196d565b906000526020600020906004020160405180608001604052908160008201805461073490611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611adf565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b505050505081526020016001820180546107c690611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546107f290611adf565b801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b5050505050815260200160028201805461085890611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461088490611adf565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020016003820180546108ea90611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461091690611adf565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050815250509050919050565b6005602052600090815260409020805461098c90611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890611adf565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b610a156112d9565b610a1f6000611333565b565b60008251600414610a745760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206368616c6c656e676573206c656e677468000000000000006044820152606401610244565b6001805483519091610a8591611c70565b14610add5760405162461bcd60e51b815260206004820152602260248201527f56616c756573206c656e677468206d69736d61746368207769746820636f6e66604482015261696760f01b6064820152608401610244565b60008581526005602052604081208054610af690611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290611adf565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b50505050509050600085518251610b869190611a40565b67ffffffffffffffff811115610b9e57610b9e6113cc565b6040519080825280601f01601f191660200182016040528015610bc8576020820181803683370190505b50905060005b8651811015610c2f57868181518110610be957610be961196d565b602001015160f81c60f81b828281518110610c0657610c0661196d565b60200101906001600160f81b031916908160001a90535080610c2781611c83565b915050610bce565b5060005b8251811015610ca057828181518110610c4e57610c4e61196d565b602001015160f81c60f81b82885183610c679190611a40565b81518110610c7757610c7761196d565b60200101906001600160f81b031916908160001a90535080610c9881611c83565b915050610c33565b506040516323fb5ad560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906347f6b5aa90610d13907f00000000000000000000000000000000000000000000000000000000000000009085908a908a90600401611c9c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d549190611a1e565b979650505050505050565b60048181548110610d6f57600080fd5b9060005260206000209060040201600091509050806000018054610d9290611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610dbe90611adf565b8015610e0b5780601f10610de057610100808354040283529160200191610e0b565b820191906000526020600020905b815481529060010190602001808311610dee57829003601f168201915b505050505090806001018054610e2090611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c90611adf565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b505050505090806002018054610eae90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90611adf565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b505050505090806003018054610f3c90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6890611adf565b8015610fb55780601f10610f8a57610100808354040283529160200191610fb5565b820191906000526020600020905b815481529060010190602001808311610f9857829003601f168201915b5050505050905084565b610fc76112d9565b60005b8151811015611225576000828281518110610fe757610fe761196d565b6020026020010151600001516040516020016110039190611ce6565b60408051601f1981840301815291815281516020928301206000818152600690935291205490915080156110795760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920766572696669656400000000000000006044820152606401610244565b600484848151811061108d5761108d61196d565b602090810291909101810151825460018101845560009384529190922082516004909202019081906110bf9082611d02565b50602082015160018201906110d49082611d02565b50604082015160028201906110e99082611d02565b50606082015160038201906110fe9082611d02565b50506004546000848152600660205260409020555083518490849081106111275761112761196d565b6020026020010151600001515160001415801561116357508383815181106111515761115161196d565b60200260200101516020015151600014155b801561118e575083838151811061117c5761117c61196d565b60200260200101516040015151600014155b80156111b957508383815181106111a7576111a761196d565b60200260200101516060015151600014155b6112105760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642070726f6f66206f662061646472657373206f776e65727368604482015261069760f41b6064820152608401610244565b5050808061121d90611c83565b915050610fca565b507f382315d4d56a6035e1899bffe77d9becefaf5f2650e4323b27854857a0454658816040516112559190611dc2565b60405180910390a150565b6112686112d9565b6001600160a01b0381166112cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610244565b6112d681611333565b50565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610244565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261139557600080fd5b50813567ffffffffffffffff8111156113ad57600080fd5b6020830191508360208285010111156113c557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611405576114056113cc565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611434576114346113cc565b604052919050565b600067ffffffffffffffff821115611456576114566113cc565b5060051b60200190565b600082601f83011261147157600080fd5b813560206114866114818361143c565b61140b565b82815260059290921b840181019181810190868411156114a557600080fd5b8286015b848110156114c057803583529183019183016114a9565b509695505050505050565b600080600080600080608087890312156114e457600080fd5b863567ffffffffffffffff808211156114fc57600080fd5b6115088a838b01611383565b9098509650602089013591508082111561152157600080fd5b61152d8a838b01611383565b9096509450604089013591508082111561154657600080fd5b5061155389828a01611460565b925050606087013590509295509295509295565b60006020828403121561157957600080fd5b5035919050565b60005b8381101561159b578181015183820152602001611583565b50506000910152565b600081518084526115bc816020860160208601611580565b601f01601f19169290920160200192915050565b60008151608084526115e560808501826115a4565b9050602083015184820360208601526115fe82826115a4565b9150506040830151848203604086015261161882826115a4565b9150506060830151848203606086015261163282826115a4565b95945050505050565b60208152600061164e60208301846115d0565b9392505050565b60208152600061164e60208301846115a4565b600082601f83011261167957600080fd5b813567ffffffffffffffff811115611693576116936113cc565b6116a6601f8201601f191660200161140b565b8181528460208386010111156116bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156116ee57600080fd5b84359350602085013567ffffffffffffffff8082111561170d57600080fd5b61171988838901611668565b9450604087013591508082111561172f57600080fd5b61173b88838901611460565b9350606087013591508082111561175157600080fd5b5061175e87828801611460565b91505092959194509250565b60808152600061177d60808301876115a4565b828103602084015261178f81876115a4565b905082810360408401526117a381866115a4565b90508281036060840152610d5481856115a4565b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b81356118046114818261143c565b81815260059190911b8301840190848101908883111561182357600080fd5b8585015b838110156119045780358581111561183e57600080fd5b86016080818c03601f190112156118555760008081fd5b61185d6113e2565b888201358781111561186f5760008081fd5b61187d8d8b83860101611668565b825250604080830135888111156118945760008081fd5b6118a28e8c83870101611668565b8b84015250606080840135898111156118bb5760008081fd5b6118c98f8d83880101611668565b838501525060808401359150888211156118e35760008081fd5b6118f18e8c84870101611668565b9083015250845250918601918601611827565b5098975050505050505050565b60006020828403121561192357600080fd5b81356001600160a01b038116811461164e57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176119675761196761193a565b92915050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526020808501945080840160005b838110156119dc578151875295820195908201906001016119c0565b509495945050505050565b6001600160a01b0385168152606060208201819052600090611a0c9083018587611983565b8281036040840152610d5481856119ac565b600060208284031215611a3057600080fd5b8151801515811461164e57600080fd5b808201808211156119675761196761193a565b60008085851115611a6357600080fd5b83861115611a7057600080fd5b5050820193919092039150565b8385823760008482016000815283858237600093019283525090949350505050565b6001600160a01b0384168152606060208201819052600090611ac3908301856115a4565b8281036040840152611ad581856119ac565b9695505050505050565b600181811c90821680611af357607f821691505b602082108103611b1357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b6357600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b5050505b505050565b67ffffffffffffffff831115611b8057611b806113cc565b611b9483611b8e8354611adf565b83611b19565b6000601f841160018114611bc85760008515611bb05750838201355b600019600387901b1c1916600186901b178355611c22565b600083815260209020601f19861690835b82811015611bf95786850135825560209485019460019092019101611bd9565b5086821015611c165760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b606081526000611c3c60608301886119ac565b8281036020840152611c4f818789611983565b90508281036040840152611c64818587611983565b98975050505050505050565b818103818111156119675761196761193a565b600060018201611c9557611c9561193a565b5060010190565b6001600160a01b0385168152608060208201819052600090611cc0908301866115a4565b8281036040840152611cd281866119ac565b90508281036060840152610d5481856119ac565b60008251611cf8818460208701611580565b9190910192915050565b815167ffffffffffffffff811115611d1c57611d1c6113cc565b611d3081611d2a8454611adf565b84611b19565b602080601f831160018114611d655760008415611d4d5750858301515b600019600386901b1c1916600185901b178555611b5f565b600085815260208120601f198616915b82811015611d9457888601518255948401946001909101908401611d75565b5085821015611db25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611e1757603f19888603018452611e058583516115d0565b94509285019290850190600101611de9565b509297965050505050505056fea264697066735822122086b05c81b0f60b1a31ee68c4dd52ab17db71abf49d4386d873f88ee7e492e86a64736f6c63430008120033","linkReferences":{},"deployedLinkReferences":{}} \ No newline at end of file +{"_format":"hh-sol-artifact-1","contractName":"Summa","sourceName":"src/Summa.sol","abi":[{"inputs":[{"internalType":"address","name":"_verifyingKey","type":"address"},{"internalType":"contract IVerifier","name":"_polynomialInterpolationVerifier","type":"address"},{"internalType":"contract IVerifier","name":"_grandSumVerifier","type":"address"},{"internalType":"contract IInclusionVerifier","name":"_inclusionVerifier","type":"address"},{"internalType":"string[]","name":"cryptocurrencyNames","type":"string[]"},{"internalType":"string[]","name":"cryptocurrencyChains","type":"string[]"},{"internalType":"uint8","name":"balanceByteRange","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"components":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"indexed":false,"internalType":"struct Summa.AddressOwnershipProof[]","name":"addressOwnershipProofs","type":"tuple[]"}],"name":"AddressOwnershipProofSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"totalBalances","type":"uint256[]"},{"indexed":false,"internalType":"bytes","name":"snarkProof","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"grandSumProof","type":"bytes"}],"name":"LiabilitiesCommitmentSubmitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"addressOwnershipProofs","outputs":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"commitments","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint8","name":"balanceByteRange","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"addressHash","type":"bytes32"}],"name":"getAddressOwnershipProof","outputs":[{"components":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"internalType":"struct Summa.AddressOwnershipProof","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"snarkProof","type":"bytes"},{"internalType":"bytes","name":"grandSumProof","type":"bytes"},{"internalType":"uint256[]","name":"totalBalances","type":"uint256[]"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"submitCommitment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"cexAddress","type":"string"},{"internalType":"string","name":"chain","type":"string"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"internalType":"struct Summa.AddressOwnershipProof[]","name":"_addressOwnershipProofs","type":"tuple[]"}],"name":"submitProofOfAddressOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"bytes","name":"inclusionProof","type":"bytes"},{"internalType":"uint256[]","name":"challenges","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"verifyInclusionProof","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"verifyingKey","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"bytecode":"0x6101006040523480156200001257600080fd5b50604051620028f5380380620028f5833981016040819052620000359162000750565b62000040336200042a565b6001600160a01b0387166200009c5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420766572696679696e67206b6579206164647265737300000060448201526064015b60405180910390fd5b6001600160a01b0387166080528151835114620001145760405162461bcd60e51b815260206004820152602f60248201527f43727970746f63757272656e6379206e616d657320616e6420636861696e732060448201526e0dceadac4cae440dad2e6dac2e8c6d608b1b606482015260840162000093565b60005b8351811015620001d1578381815181106200013657620001366200082c565b6020026020010151516000141580156200016e57508281815181106200016057620001606200082c565b602002602001015151600014155b620001bc5760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642063727970746f63757272656e637900000000000000000000604482015260640162000093565b80620001c88162000858565b91505062000117565b50620001e6878451836200047a60201b60201c565b6200025a5760405162461bcd60e51b815260206004820152603c60248201527f54686520636f6e66696720706172616d657465727320646f206e6f7420636f7260448201527f726573706f6e6420746f2074686520766572696679696e67206b657900000000606482015260840162000093565b6001600160a01b038616620002cc5760405162461bcd60e51b815260206004820152603160248201527f496e76616c696420706f6c796e6f6d69616c20696e746572706f6c6174696f6e604482015270207665726966696572206164647265737360781b606482015260840162000093565b6001600160a01b0380871660a0528516620003355760405162461bcd60e51b815260206004820152602260248201527f496e76616c6964206772616e642073756d207665726966696572206164647265604482015261737360f01b606482015260840162000093565b6001600160a01b0380861660c05284166200039e5760405162461bcd60e51b815260206004820152602260248201527f496e76616c696420696e636c7573696f6e207665726966696572206164647265604482015261737360f01b606482015260840162000093565b6001600160a01b03841660e05260408051606081018252848152602080820185905260ff84169282019290925284519091600191620003e391839190880190620004fc565b506020828101518051620003fe9260018501920190620004fc565b50604091909101516002909101805460ff191660ff9092169190911790555062000a4c95505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080836200048b60028562000874565b60ff166200049a9190620008a5565b620004a7906002620008c5565b90506102e06000620004bb836040620008a5565b620004c79083620008c5565b90506000620004d8601083620008db565b9050600060208260008b3c5050600051600f81161590151916979650505050505050565b82805482825590600052602060002090810192821562000547579160200282015b8281111562000547578251829062000536908262000980565b50916020019190600101906200051d565b506200055592915062000559565b5090565b80821115620005555760006200057082826200057a565b5060010162000559565b5080546200058890620008f1565b6000825580601f1062000599575050565b601f016020900490600052602060002090810190620005b99190620005bc565b50565b5b80821115620005555760008155600101620005bd565b6001600160a01b0381168114620005b957600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200062a576200062a620005e9565b604052919050565b6000601f83818401126200064557600080fd5b825160206001600160401b0380831115620006645762000664620005e9565b8260051b62000675838201620005ff565b93845286810183019383810190898611156200069057600080fd5b84890192505b858310156200074357825184811115620006b05760008081fd5b8901603f81018b13620006c35760008081fd5b8581015185811115620006da57620006da620005e9565b620006ed818a01601f19168801620005ff565b81815260408d81848601011115620007055760008081fd5b60005b8381101562000725578481018201518382018b0152890162000708565b50506000918101880191909152835250918401919084019062000696565b9998505050505050505050565b600080600080600080600060e0888a0312156200076c57600080fd5b87516200077981620005d3565b60208901519097506200078c81620005d3565b60408901519096506200079f81620005d3565b6060890151909550620007b281620005d3565b60808901519094506001600160401b0380821115620007d057600080fd5b620007de8b838c0162000632565b945060a08a0151915080821115620007f557600080fd5b50620008048a828b0162000632565b92505060c088015160ff811681146200081c57600080fd5b8091505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200086d576200086d62000842565b5060010190565b600060ff8316806200089657634e487b7160e01b600052601260045260246000fd5b8060ff84160491505092915050565b8082028115828204841417620008bf57620008bf62000842565b92915050565b80820180821115620008bf57620008bf62000842565b81810381811115620008bf57620008bf62000842565b600181811c908216806200090657607f821691505b6020821081036200092757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200097b57600081815260208120601f850160051c81016020861015620009565750805b601f850160051c820191505b81811015620009775782815560010162000962565b5050505b505050565b81516001600160401b038111156200099c576200099c620005e9565b620009b481620009ad8454620008f1565b846200092d565b602080601f831160018114620009ec5760008415620009d35750858301515b600019600386901b1c1916600185901b17855562000977565b600085815260208120601f198616915b8281101562000a1d57888601518255948401946001909101908401620009fc565b508582101562000a3c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e051611e5a62000a9b6000396000610cb801526000610514015260006103500152600081816101380152818161037d015281816105410152610ce50152611e5a6000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637950c5f8116100715780637950c5f8146101335780638da5cb5b146101725780639c38255914610183578063a3c4bcf8146101a6578063c7ddca0e146101c9578063f2fde38b146101dc57600080fd5b806305ab9860146100ae57806319b33968146100c357806349ce8997146100ec578063715018a61461010c57806379502c5514610114575b600080fd5b6100c16100bc3660046114cb565b6101ef565b005b6100d66100d1366004611567565b610660565b6040516100e3919061163b565b60405180910390f35b6100ff6100fa366004611567565b610973565b6040516100e39190611655565b6100c1610a0d565b6003546101219060ff1681565b60405160ff90911681526020016100e3565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100e3565b6000546001600160a01b031661015a565b6101966101913660046116d8565b610a21565b60405190151581526020016100e3565b6101b96101b4366004611567565b610d5f565b6040516100e3949392919061176a565b6100c16101d73660046117b7565b610fbf565b6100c16101ea366004611911565b611260565b6101f76112d9565b600082511161024d5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420746f74616c2062616c616e636573206c656e67746800000060448201526064015b60405180910390fd5b815161025a906040611950565b83146102a85760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964206772616e642073756d2070726f6f66206c656e67746800006044820152606401610244565b8285116102f75760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736e61726b2070726f6f66206c656e6774680000000000006044820152606401610244565b6040805160018082528183019092526000916020808301908036833701905050905060018160008151811061032e5761032e61196d565b602090810291909101015260405163af83a18d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d906103ab907f0000000000000000000000000000000000000000000000000000000000000000908b908b9087906004016119e7565b602060405180830381865afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec9190611a1e565b61042e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21039b730b93590383937b7b360691b6044820152606401610244565b6001548351146104a65760405162461bcd60e51b815260206004820152603a60248201527f4c696162696c69747920636f6d6d69746d656e747320616e642063727970746f60448201527f63757272656e63696573206e756d626572206d69736d617463680000000000006064820152608401610244565b3660008881896104b7896040611a40565b926104c493929190611a53565b9092509050600087876104da8460408188611a53565b6040516020016104ed9493929190611a7d565b60408051601f198184030181529082905263af83a18d60e01b825291506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d9061056d907f00000000000000000000000000000000000000000000000000000000000000009085908b90600401611a9f565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611a1e565b6105fa5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206772616e642073756d2070726f6f660000000000000000006044820152606401610244565b6000858152600560205260409020610613838583611b68565b50847f7603a12a8838a565715ddb5bbf625b3f00a5e6f4793437537963e30c3b9495dc8785858c8c60405161064c959493929190611c29565b60405180910390a250505050505050505050565b61068b6040518060800160405280606081526020016060815260200160608152602001606081525090565b6000828152600660205260409020546106dd5760405162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b6044820152606401610244565b6000828152600660205260409020546004906106fb90600190611c70565b8154811061070b5761070b61196d565b906000526020600020906004020160405180608001604052908160008201805461073490611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611adf565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b505050505081526020016001820180546107c690611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546107f290611adf565b801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b5050505050815260200160028201805461085890611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461088490611adf565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020016003820180546108ea90611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461091690611adf565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050815250509050919050565b6005602052600090815260409020805461098c90611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890611adf565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b610a156112d9565b610a1f6000611333565b565b60008251600414610a745760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206368616c6c656e676573206c656e677468000000000000006044820152606401610244565b6001805483519091610a8591611c70565b14610add5760405162461bcd60e51b815260206004820152602260248201527f56616c756573206c656e677468206d69736d61746368207769746820636f6e66604482015261696760f01b6064820152608401610244565b60008581526005602052604081208054610af690611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290611adf565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b50505050509050600085518251610b869190611a40565b67ffffffffffffffff811115610b9e57610b9e6113cc565b6040519080825280601f01601f191660200182016040528015610bc8576020820181803683370190505b50905060005b8651811015610c2f57868181518110610be957610be961196d565b602001015160f81c60f81b828281518110610c0657610c0661196d565b60200101906001600160f81b031916908160001a90535080610c2781611c83565b915050610bce565b5060005b8251811015610ca057828181518110610c4e57610c4e61196d565b602001015160f81c60f81b82885183610c679190611a40565b81518110610c7757610c7761196d565b60200101906001600160f81b031916908160001a90535080610c9881611c83565b915050610c33565b506040516323fb5ad560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906347f6b5aa90610d13907f00000000000000000000000000000000000000000000000000000000000000009085908a908a90600401611c9c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d549190611a1e565b979650505050505050565b60048181548110610d6f57600080fd5b9060005260206000209060040201600091509050806000018054610d9290611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610dbe90611adf565b8015610e0b5780601f10610de057610100808354040283529160200191610e0b565b820191906000526020600020905b815481529060010190602001808311610dee57829003601f168201915b505050505090806001018054610e2090611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c90611adf565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b505050505090806002018054610eae90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90611adf565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b505050505090806003018054610f3c90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6890611adf565b8015610fb55780601f10610f8a57610100808354040283529160200191610fb5565b820191906000526020600020905b815481529060010190602001808311610f9857829003601f168201915b5050505050905084565b610fc76112d9565b60005b8151811015611225576000828281518110610fe757610fe761196d565b6020026020010151600001516040516020016110039190611ce6565b60408051601f1981840301815291815281516020928301206000818152600690935291205490915080156110795760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920766572696669656400000000000000006044820152606401610244565b600484848151811061108d5761108d61196d565b602090810291909101810151825460018101845560009384529190922082516004909202019081906110bf9082611d02565b50602082015160018201906110d49082611d02565b50604082015160028201906110e99082611d02565b50606082015160038201906110fe9082611d02565b50506004546000848152600660205260409020555083518490849081106111275761112761196d565b6020026020010151600001515160001415801561116357508383815181106111515761115161196d565b60200260200101516020015151600014155b801561118e575083838151811061117c5761117c61196d565b60200260200101516040015151600014155b80156111b957508383815181106111a7576111a761196d565b60200260200101516060015151600014155b6112105760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642070726f6f66206f662061646472657373206f776e65727368604482015261069760f41b6064820152608401610244565b5050808061121d90611c83565b915050610fca565b507f382315d4d56a6035e1899bffe77d9becefaf5f2650e4323b27854857a0454658816040516112559190611dc2565b60405180910390a150565b6112686112d9565b6001600160a01b0381166112cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610244565b6112d681611333565b50565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610244565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261139557600080fd5b50813567ffffffffffffffff8111156113ad57600080fd5b6020830191508360208285010111156113c557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611405576114056113cc565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611434576114346113cc565b604052919050565b600067ffffffffffffffff821115611456576114566113cc565b5060051b60200190565b600082601f83011261147157600080fd5b813560206114866114818361143c565b61140b565b82815260059290921b840181019181810190868411156114a557600080fd5b8286015b848110156114c057803583529183019183016114a9565b509695505050505050565b600080600080600080608087890312156114e457600080fd5b863567ffffffffffffffff808211156114fc57600080fd5b6115088a838b01611383565b9098509650602089013591508082111561152157600080fd5b61152d8a838b01611383565b9096509450604089013591508082111561154657600080fd5b5061155389828a01611460565b925050606087013590509295509295509295565b60006020828403121561157957600080fd5b5035919050565b60005b8381101561159b578181015183820152602001611583565b50506000910152565b600081518084526115bc816020860160208601611580565b601f01601f19169290920160200192915050565b60008151608084526115e560808501826115a4565b9050602083015184820360208601526115fe82826115a4565b9150506040830151848203604086015261161882826115a4565b9150506060830151848203606086015261163282826115a4565b95945050505050565b60208152600061164e60208301846115d0565b9392505050565b60208152600061164e60208301846115a4565b600082601f83011261167957600080fd5b813567ffffffffffffffff811115611693576116936113cc565b6116a6601f8201601f191660200161140b565b8181528460208386010111156116bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156116ee57600080fd5b84359350602085013567ffffffffffffffff8082111561170d57600080fd5b61171988838901611668565b9450604087013591508082111561172f57600080fd5b61173b88838901611460565b9350606087013591508082111561175157600080fd5b5061175e87828801611460565b91505092959194509250565b60808152600061177d60808301876115a4565b828103602084015261178f81876115a4565b905082810360408401526117a381866115a4565b90508281036060840152610d5481856115a4565b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b81356118046114818261143c565b81815260059190911b8301840190848101908883111561182357600080fd5b8585015b838110156119045780358581111561183e57600080fd5b86016080818c03601f190112156118555760008081fd5b61185d6113e2565b888201358781111561186f5760008081fd5b61187d8d8b83860101611668565b825250604080830135888111156118945760008081fd5b6118a28e8c83870101611668565b8b84015250606080840135898111156118bb5760008081fd5b6118c98f8d83880101611668565b838501525060808401359150888211156118e35760008081fd5b6118f18e8c84870101611668565b9083015250845250918601918601611827565b5098975050505050505050565b60006020828403121561192357600080fd5b81356001600160a01b038116811461164e57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176119675761196761193a565b92915050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526020808501945080840160005b838110156119dc578151875295820195908201906001016119c0565b509495945050505050565b6001600160a01b0385168152606060208201819052600090611a0c9083018587611983565b8281036040840152610d5481856119ac565b600060208284031215611a3057600080fd5b8151801515811461164e57600080fd5b808201808211156119675761196761193a565b60008085851115611a6357600080fd5b83861115611a7057600080fd5b5050820193919092039150565b8385823760008482016000815283858237600093019283525090949350505050565b6001600160a01b0384168152606060208201819052600090611ac3908301856115a4565b8281036040840152611ad581856119ac565b9695505050505050565b600181811c90821680611af357607f821691505b602082108103611b1357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b6357600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b5050505b505050565b67ffffffffffffffff831115611b8057611b806113cc565b611b9483611b8e8354611adf565b83611b19565b6000601f841160018114611bc85760008515611bb05750838201355b600019600387901b1c1916600186901b178355611c22565b600083815260209020601f19861690835b82811015611bf95786850135825560209485019460019092019101611bd9565b5086821015611c165760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b606081526000611c3c60608301886119ac565b8281036020840152611c4f818789611983565b90508281036040840152611c64818587611983565b98975050505050505050565b818103818111156119675761196761193a565b600060018201611c9557611c9561193a565b5060010190565b6001600160a01b0385168152608060208201819052600090611cc0908301866115a4565b8281036040840152611cd281866119ac565b90508281036060840152610d5481856119ac565b60008251611cf8818460208701611580565b9190910192915050565b815167ffffffffffffffff811115611d1c57611d1c6113cc565b611d3081611d2a8454611adf565b84611b19565b602080601f831160018114611d655760008415611d4d5750858301515b600019600386901b1c1916600185901b178555611b5f565b600085815260208120601f198616915b82811015611d9457888601518255948401946001909101908401611d75565b5085821015611db25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611e1757603f19888603018452611e058583516115d0565b94509285019290850190600101611de9565b509297965050505050505056fea26469706673582212205cdd3459cf967f298c8255f0d839582dc7dd41555230f51421901f60f838962064736f6c63430008120033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80637950c5f8116100715780637950c5f8146101335780638da5cb5b146101725780639c38255914610183578063a3c4bcf8146101a6578063c7ddca0e146101c9578063f2fde38b146101dc57600080fd5b806305ab9860146100ae57806319b33968146100c357806349ce8997146100ec578063715018a61461010c57806379502c5514610114575b600080fd5b6100c16100bc3660046114cb565b6101ef565b005b6100d66100d1366004611567565b610660565b6040516100e3919061163b565b60405180910390f35b6100ff6100fa366004611567565b610973565b6040516100e39190611655565b6100c1610a0d565b6003546101219060ff1681565b60405160ff90911681526020016100e3565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100e3565b6000546001600160a01b031661015a565b6101966101913660046116d8565b610a21565b60405190151581526020016100e3565b6101b96101b4366004611567565b610d5f565b6040516100e3949392919061176a565b6100c16101d73660046117b7565b610fbf565b6100c16101ea366004611911565b611260565b6101f76112d9565b600082511161024d5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420746f74616c2062616c616e636573206c656e67746800000060448201526064015b60405180910390fd5b815161025a906040611950565b83146102a85760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964206772616e642073756d2070726f6f66206c656e67746800006044820152606401610244565b8285116102f75760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736e61726b2070726f6f66206c656e6774680000000000006044820152606401610244565b6040805160018082528183019092526000916020808301908036833701905050905060018160008151811061032e5761032e61196d565b602090810291909101015260405163af83a18d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d906103ab907f0000000000000000000000000000000000000000000000000000000000000000908b908b9087906004016119e7565b602060405180830381865afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec9190611a1e565b61042e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21039b730b93590383937b7b360691b6044820152606401610244565b6001548351146104a65760405162461bcd60e51b815260206004820152603a60248201527f4c696162696c69747920636f6d6d69746d656e747320616e642063727970746f60448201527f63757272656e63696573206e756d626572206d69736d617463680000000000006064820152608401610244565b3660008881896104b7896040611a40565b926104c493929190611a53565b9092509050600087876104da8460408188611a53565b6040516020016104ed9493929190611a7d565b60408051601f198184030181529082905263af83a18d60e01b825291506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d9061056d907f00000000000000000000000000000000000000000000000000000000000000009085908b90600401611a9f565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611a1e565b6105fa5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206772616e642073756d2070726f6f660000000000000000006044820152606401610244565b6000858152600560205260409020610613838583611b68565b50847f7603a12a8838a565715ddb5bbf625b3f00a5e6f4793437537963e30c3b9495dc8785858c8c60405161064c959493929190611c29565b60405180910390a250505050505050505050565b61068b6040518060800160405280606081526020016060815260200160608152602001606081525090565b6000828152600660205260409020546106dd5760405162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b6044820152606401610244565b6000828152600660205260409020546004906106fb90600190611c70565b8154811061070b5761070b61196d565b906000526020600020906004020160405180608001604052908160008201805461073490611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611adf565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b505050505081526020016001820180546107c690611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546107f290611adf565b801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b5050505050815260200160028201805461085890611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461088490611adf565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020016003820180546108ea90611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461091690611adf565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050815250509050919050565b6005602052600090815260409020805461098c90611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890611adf565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b610a156112d9565b610a1f6000611333565b565b60008251600414610a745760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206368616c6c656e676573206c656e677468000000000000006044820152606401610244565b6001805483519091610a8591611c70565b14610add5760405162461bcd60e51b815260206004820152602260248201527f56616c756573206c656e677468206d69736d61746368207769746820636f6e66604482015261696760f01b6064820152608401610244565b60008581526005602052604081208054610af690611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290611adf565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b50505050509050600085518251610b869190611a40565b67ffffffffffffffff811115610b9e57610b9e6113cc565b6040519080825280601f01601f191660200182016040528015610bc8576020820181803683370190505b50905060005b8651811015610c2f57868181518110610be957610be961196d565b602001015160f81c60f81b828281518110610c0657610c0661196d565b60200101906001600160f81b031916908160001a90535080610c2781611c83565b915050610bce565b5060005b8251811015610ca057828181518110610c4e57610c4e61196d565b602001015160f81c60f81b82885183610c679190611a40565b81518110610c7757610c7761196d565b60200101906001600160f81b031916908160001a90535080610c9881611c83565b915050610c33565b506040516323fb5ad560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906347f6b5aa90610d13907f00000000000000000000000000000000000000000000000000000000000000009085908a908a90600401611c9c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d549190611a1e565b979650505050505050565b60048181548110610d6f57600080fd5b9060005260206000209060040201600091509050806000018054610d9290611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610dbe90611adf565b8015610e0b5780601f10610de057610100808354040283529160200191610e0b565b820191906000526020600020905b815481529060010190602001808311610dee57829003601f168201915b505050505090806001018054610e2090611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c90611adf565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b505050505090806002018054610eae90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90611adf565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b505050505090806003018054610f3c90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6890611adf565b8015610fb55780601f10610f8a57610100808354040283529160200191610fb5565b820191906000526020600020905b815481529060010190602001808311610f9857829003601f168201915b5050505050905084565b610fc76112d9565b60005b8151811015611225576000828281518110610fe757610fe761196d565b6020026020010151600001516040516020016110039190611ce6565b60408051601f1981840301815291815281516020928301206000818152600690935291205490915080156110795760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920766572696669656400000000000000006044820152606401610244565b600484848151811061108d5761108d61196d565b602090810291909101810151825460018101845560009384529190922082516004909202019081906110bf9082611d02565b50602082015160018201906110d49082611d02565b50604082015160028201906110e99082611d02565b50606082015160038201906110fe9082611d02565b50506004546000848152600660205260409020555083518490849081106111275761112761196d565b6020026020010151600001515160001415801561116357508383815181106111515761115161196d565b60200260200101516020015151600014155b801561118e575083838151811061117c5761117c61196d565b60200260200101516040015151600014155b80156111b957508383815181106111a7576111a761196d565b60200260200101516060015151600014155b6112105760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642070726f6f66206f662061646472657373206f776e65727368604482015261069760f41b6064820152608401610244565b5050808061121d90611c83565b915050610fca565b507f382315d4d56a6035e1899bffe77d9becefaf5f2650e4323b27854857a0454658816040516112559190611dc2565b60405180910390a150565b6112686112d9565b6001600160a01b0381166112cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610244565b6112d681611333565b50565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610244565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261139557600080fd5b50813567ffffffffffffffff8111156113ad57600080fd5b6020830191508360208285010111156113c557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611405576114056113cc565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611434576114346113cc565b604052919050565b600067ffffffffffffffff821115611456576114566113cc565b5060051b60200190565b600082601f83011261147157600080fd5b813560206114866114818361143c565b61140b565b82815260059290921b840181019181810190868411156114a557600080fd5b8286015b848110156114c057803583529183019183016114a9565b509695505050505050565b600080600080600080608087890312156114e457600080fd5b863567ffffffffffffffff808211156114fc57600080fd5b6115088a838b01611383565b9098509650602089013591508082111561152157600080fd5b61152d8a838b01611383565b9096509450604089013591508082111561154657600080fd5b5061155389828a01611460565b925050606087013590509295509295509295565b60006020828403121561157957600080fd5b5035919050565b60005b8381101561159b578181015183820152602001611583565b50506000910152565b600081518084526115bc816020860160208601611580565b601f01601f19169290920160200192915050565b60008151608084526115e560808501826115a4565b9050602083015184820360208601526115fe82826115a4565b9150506040830151848203604086015261161882826115a4565b9150506060830151848203606086015261163282826115a4565b95945050505050565b60208152600061164e60208301846115d0565b9392505050565b60208152600061164e60208301846115a4565b600082601f83011261167957600080fd5b813567ffffffffffffffff811115611693576116936113cc565b6116a6601f8201601f191660200161140b565b8181528460208386010111156116bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156116ee57600080fd5b84359350602085013567ffffffffffffffff8082111561170d57600080fd5b61171988838901611668565b9450604087013591508082111561172f57600080fd5b61173b88838901611460565b9350606087013591508082111561175157600080fd5b5061175e87828801611460565b91505092959194509250565b60808152600061177d60808301876115a4565b828103602084015261178f81876115a4565b905082810360408401526117a381866115a4565b90508281036060840152610d5481856115a4565b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b81356118046114818261143c565b81815260059190911b8301840190848101908883111561182357600080fd5b8585015b838110156119045780358581111561183e57600080fd5b86016080818c03601f190112156118555760008081fd5b61185d6113e2565b888201358781111561186f5760008081fd5b61187d8d8b83860101611668565b825250604080830135888111156118945760008081fd5b6118a28e8c83870101611668565b8b84015250606080840135898111156118bb5760008081fd5b6118c98f8d83880101611668565b838501525060808401359150888211156118e35760008081fd5b6118f18e8c84870101611668565b9083015250845250918601918601611827565b5098975050505050505050565b60006020828403121561192357600080fd5b81356001600160a01b038116811461164e57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176119675761196761193a565b92915050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526020808501945080840160005b838110156119dc578151875295820195908201906001016119c0565b509495945050505050565b6001600160a01b0385168152606060208201819052600090611a0c9083018587611983565b8281036040840152610d5481856119ac565b600060208284031215611a3057600080fd5b8151801515811461164e57600080fd5b808201808211156119675761196761193a565b60008085851115611a6357600080fd5b83861115611a7057600080fd5b5050820193919092039150565b8385823760008482016000815283858237600093019283525090949350505050565b6001600160a01b0384168152606060208201819052600090611ac3908301856115a4565b8281036040840152611ad581856119ac565b9695505050505050565b600181811c90821680611af357607f821691505b602082108103611b1357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b6357600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b5050505b505050565b67ffffffffffffffff831115611b8057611b806113cc565b611b9483611b8e8354611adf565b83611b19565b6000601f841160018114611bc85760008515611bb05750838201355b600019600387901b1c1916600186901b178355611c22565b600083815260209020601f19861690835b82811015611bf95786850135825560209485019460019092019101611bd9565b5086821015611c165760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b606081526000611c3c60608301886119ac565b8281036020840152611c4f818789611983565b90508281036040840152611c64818587611983565b98975050505050505050565b818103818111156119675761196761193a565b600060018201611c9557611c9561193a565b5060010190565b6001600160a01b0385168152608060208201819052600090611cc0908301866115a4565b8281036040840152611cd281866119ac565b90508281036060840152610d5481856119ac565b60008251611cf8818460208701611580565b9190910192915050565b815167ffffffffffffffff811115611d1c57611d1c6113cc565b611d3081611d2a8454611adf565b84611b19565b602080601f831160018114611d655760008415611d4d5750858301515b600019600386901b1c1916600185901b178555611b5f565b600085815260208120601f198616915b82811015611d9457888601518255948401946001909101908401611d75565b5085821015611db25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611e1757603f19888603018452611e058583516115d0565b94509285019290850190600101611de9565b509297965050505050505056fea26469706673582212205cdd3459cf967f298c8255f0d839582dc7dd41555230f51421901f60f838962064736f6c63430008120033","linkReferences":{},"deployedLinkReferences":{}} \ No newline at end of file diff --git a/backend/src/contracts/generated/summa_contract.rs b/backend/src/contracts/generated/summa_contract.rs index 06b5c240..081dfaa0 100644 --- a/backend/src/contracts/generated/summa_contract.rs +++ b/backend/src/contracts/generated/summa_contract.rs @@ -7,16 +7,14 @@ pub use summa::*; clippy::upper_case_acronyms, clippy::type_complexity, dead_code, - non_camel_case_types + non_camel_case_types, )] pub mod summa { #[rustfmt::skip] - const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_verifyingKey\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"contract IVerifier\",\"name\":\"_polynomialEncodingVerifier\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"contract IVerifier\",\"name\":\"_grandSumVerifier\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"contract IInclusionVerifier\",\"name\":\"_inclusionVerifier\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"string[]\",\"name\":\"cryptocurrencyNames\",\"type\":\"string[]\",\"components\":[]},{\"internalType\":\"string[]\",\"name\":\"cryptocurrencyChains\",\"type\":\"string[]\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"balanceByteRange\",\"type\":\"uint8\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"struct Summa.AddressOwnershipProof[]\",\"name\":\"addressOwnershipProofs\",\"type\":\"tuple[]\",\"components\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}],\"indexed\":false}],\"type\":\"event\",\"name\":\"AddressOwnershipProofSubmitted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256[]\",\"name\":\"totalBalances\",\"type\":\"uint256[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"snarkProof\",\"type\":\"bytes\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"grandSumProof\",\"type\":\"bytes\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"LiabilitiesCommitmentSubmitted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"addressOwnershipProofs\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"commitments\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"config\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"balanceByteRange\",\"type\":\"uint8\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"addressHash\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getAddressOwnershipProof\",\"outputs\":[{\"internalType\":\"struct Summa.AddressOwnershipProof\",\"name\":\"\",\"type\":\"tuple\",\"components\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"renounceOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"snarkProof\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"grandSumProof\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"totalBalances\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"submitCommitment\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"struct Summa.AddressOwnershipProof[]\",\"name\":\"_addressOwnershipProofs\",\"type\":\"tuple[]\",\"components\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"submitProofOfAddressOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"inclusionProof\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"challenges\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"verifyInclusionProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"verifyingKey\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]}]"; + const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_verifyingKey\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"contract IVerifier\",\"name\":\"_polynomialInterpolationVerifier\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"contract IVerifier\",\"name\":\"_grandSumVerifier\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"contract IInclusionVerifier\",\"name\":\"_inclusionVerifier\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"string[]\",\"name\":\"cryptocurrencyNames\",\"type\":\"string[]\",\"components\":[]},{\"internalType\":\"string[]\",\"name\":\"cryptocurrencyChains\",\"type\":\"string[]\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"balanceByteRange\",\"type\":\"uint8\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"struct Summa.AddressOwnershipProof[]\",\"name\":\"addressOwnershipProofs\",\"type\":\"tuple[]\",\"components\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}],\"indexed\":false}],\"type\":\"event\",\"name\":\"AddressOwnershipProofSubmitted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256[]\",\"name\":\"totalBalances\",\"type\":\"uint256[]\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"snarkProof\",\"type\":\"bytes\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"grandSumProof\",\"type\":\"bytes\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"LiabilitiesCommitmentSubmitted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"addressOwnershipProofs\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"commitments\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"config\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"balanceByteRange\",\"type\":\"uint8\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"addressHash\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getAddressOwnershipProof\",\"outputs\":[{\"internalType\":\"struct Summa.AddressOwnershipProof\",\"name\":\"\",\"type\":\"tuple\",\"components\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"renounceOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"snarkProof\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"grandSumProof\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"totalBalances\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"submitCommitment\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"struct Summa.AddressOwnershipProof[]\",\"name\":\"_addressOwnershipProofs\",\"type\":\"tuple[]\",\"components\":[{\"internalType\":\"string\",\"name\":\"cexAddress\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"chain\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\",\"components\":[]}]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"submitProofOfAddressOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"inclusionProof\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"challenges\",\"type\":\"uint256[]\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"verifyInclusionProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"verifyingKey\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]}]"; ///The parsed JSON ABI of the contract. - pub static SUMMA_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(|| { - ::ethers::core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid") - }); + pub static SUMMA_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(|| + ::ethers::core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid")); #[rustfmt::skip] const __BYTECODE: &[u8] = &[ 97, @@ -45,14 +43,14 @@ pub mod summa { 98, 0, 40, - 240, + 245, 56, 3, 128, 98, 0, 40, - 240, + 245, 131, 57, 129, @@ -70,7 +68,7 @@ pub mod summa { 98, 0, 7, - 75, + 80, 86, 91, 98, @@ -81,7 +79,7 @@ pub mod summa { 98, 0, 4, - 37, + 42, 86, 91, 96, @@ -327,7 +325,7 @@ pub mod summa { 98, 0, 8, - 39, + 44, 86, 91, 96, @@ -369,7 +367,7 @@ pub mod summa { 98, 0, 8, - 39, + 44, 86, 91, 96, @@ -473,7 +471,7 @@ pub mod summa { 98, 0, 8, - 83, + 88, 86, 91, 145, @@ -497,7 +495,7 @@ pub mod summa { 98, 0, 4, - 117, + 122, 96, 32, 27, @@ -635,7 +633,7 @@ pub mod summa { 98, 0, 2, - 199, + 204, 87, 96, 64, @@ -657,7 +655,7 @@ pub mod summa { 1, 82, 96, - 44, + 49, 96, 36, 130, @@ -683,25 +681,30 @@ pub mod summa { 97, 108, 32, - 101, - 110, - 99, - 111, - 100, 105, 110, - 103, - 32, - 118, + 116, 101, 114, + 112, + 111, + 108, + 97, + 116, 105, + 111, + 110, 96, 68, 130, 1, 82, - 107, + 112, + 32, + 118, + 101, + 114, + 105, 102, 105, 101, @@ -715,7 +718,7 @@ pub mod summa { 115, 115, 96, - 160, + 120, 27, 96, 100, @@ -750,7 +753,7 @@ pub mod summa { 98, 0, 3, - 48, + 53, 87, 96, 64, @@ -855,7 +858,7 @@ pub mod summa { 98, 0, 3, - 153, + 158, 87, 96, 64, @@ -996,7 +999,7 @@ pub mod summa { 98, 0, 3, - 222, + 227, 145, 131, 145, @@ -1007,7 +1010,7 @@ pub mod summa { 98, 0, 4, - 247, + 252, 86, 91, 80, @@ -1022,7 +1025,7 @@ pub mod summa { 98, 0, 3, - 249, + 254, 146, 96, 1, @@ -1034,7 +1037,7 @@ pub mod summa { 98, 0, 4, - 247, + 252, 86, 91, 80, @@ -1071,7 +1074,7 @@ pub mod summa { 98, 0, 10, - 71, + 76, 149, 80, 80, @@ -1168,14 +1171,14 @@ pub mod summa { 98, 0, 4, - 134, + 139, 96, 2, 133, 98, 0, 8, - 111, + 116, 86, 91, 96, @@ -1184,26 +1187,26 @@ pub mod summa { 98, 0, 4, - 149, + 154, 145, 144, 98, 0, 8, - 160, + 165, 86, 91, 98, 0, 4, - 162, + 167, 144, 96, 2, 98, 0, 8, - 192, + 197, 86, 91, 144, @@ -1216,26 +1219,26 @@ pub mod summa { 98, 0, 4, - 182, + 187, 131, 96, 64, 98, 0, 8, - 160, + 165, 86, 91, 98, 0, 4, - 194, + 199, 144, 131, 98, 0, 8, - 192, + 197, 86, 91, 144, @@ -1245,14 +1248,14 @@ pub mod summa { 98, 0, 4, - 211, + 216, 96, 16, 131, 98, 0, 8, - 214, + 219, 86, 91, 144, @@ -1315,7 +1318,7 @@ pub mod summa { 98, 0, 5, - 66, + 71, 87, 145, 96, @@ -1331,7 +1334,7 @@ pub mod summa { 98, 0, 5, - 66, + 71, 87, 130, 81, @@ -1340,13 +1343,13 @@ pub mod summa { 98, 0, 5, - 49, + 54, 144, 130, 98, 0, 9, - 123, + 128, 86, 91, 80, @@ -1363,21 +1366,21 @@ pub mod summa { 98, 0, 5, - 24, + 29, 86, 91, 80, 98, 0, 5, - 80, + 85, 146, 145, 80, 98, 0, 5, - 84, + 89, 86, 91, 80, @@ -1391,20 +1394,20 @@ pub mod summa { 98, 0, 5, - 80, + 85, 87, 96, 0, 98, 0, 5, - 107, + 112, 130, 130, 98, 0, 5, - 117, + 122, 86, 91, 80, @@ -1414,7 +1417,7 @@ pub mod summa { 98, 0, 5, - 84, + 89, 86, 91, 80, @@ -1423,12 +1426,12 @@ pub mod summa { 98, 0, 5, - 131, + 136, 144, 98, 0, 8, - 236, + 241, 86, 91, 96, @@ -1442,7 +1445,7 @@ pub mod summa { 98, 0, 5, - 148, + 153, 87, 80, 80, @@ -1471,13 +1474,13 @@ pub mod summa { 98, 0, 5, - 180, + 185, 145, 144, 98, 0, 5, - 183, + 188, 86, 91, 80, @@ -1491,7 +1494,7 @@ pub mod summa { 98, 0, 5, - 80, + 85, 87, 96, 0, @@ -1503,7 +1506,7 @@ pub mod summa { 98, 0, 5, - 184, + 189, 86, 91, 96, @@ -1521,7 +1524,7 @@ pub mod summa { 98, 0, 5, - 180, + 185, 87, 96, 0, @@ -1581,16 +1584,16 @@ pub mod summa { 98, 0, 6, - 37, + 42, 87, 98, 0, 6, - 37, + 42, 98, 0, 5, - 228, + 233, 86, 91, 96, @@ -1613,7 +1616,7 @@ pub mod summa { 98, 0, 6, - 64, + 69, 87, 96, 0, @@ -1639,16 +1642,16 @@ pub mod summa { 98, 0, 6, - 95, + 100, 87, 98, 0, 6, - 95, + 100, 98, 0, 5, - 228, + 233, 86, 91, 130, @@ -1658,14 +1661,14 @@ pub mod summa { 98, 0, 6, - 112, + 117, 131, 130, 1, 98, 0, 5, - 250, + 255, 86, 91, 147, @@ -1688,7 +1691,7 @@ pub mod summa { 98, 0, 6, - 139, + 144, 87, 96, 0, @@ -1708,7 +1711,7 @@ pub mod summa { 98, 0, 7, - 62, + 67, 87, 130, 81, @@ -1719,7 +1722,7 @@ pub mod summa { 98, 0, 6, - 171, + 176, 87, 96, 0, @@ -1738,7 +1741,7 @@ pub mod summa { 98, 0, 6, - 190, + 195, 87, 96, 0, @@ -1757,22 +1760,22 @@ pub mod summa { 98, 0, 6, - 213, + 218, 87, 98, 0, 6, - 213, + 218, 98, 0, 5, - 228, + 233, 86, 91, 98, 0, 6, - 232, + 237, 129, 138, 1, @@ -1785,7 +1788,7 @@ pub mod summa { 98, 0, 5, - 250, + 255, 86, 91, 129, @@ -1804,7 +1807,7 @@ pub mod summa { 98, 0, 7, - 0, + 5, 87, 96, 0, @@ -1822,7 +1825,7 @@ pub mod summa { 98, 0, 7, - 32, + 37, 87, 132, 129, @@ -1841,7 +1844,7 @@ pub mod summa { 98, 0, 7, - 3, + 8, 86, 91, 80, @@ -1871,7 +1874,7 @@ pub mod summa { 98, 0, 6, - 145, + 150, 86, 91, 153, @@ -1908,7 +1911,7 @@ pub mod summa { 98, 0, 7, - 103, + 108, 87, 96, 0, @@ -1920,12 +1923,12 @@ pub mod summa { 98, 0, 7, - 116, + 121, 129, 98, 0, 5, - 206, + 211, 86, 91, 96, @@ -1939,12 +1942,12 @@ pub mod summa { 98, 0, 7, - 135, + 140, 129, 98, 0, 5, - 206, + 211, 86, 91, 96, @@ -1958,12 +1961,12 @@ pub mod summa { 98, 0, 7, - 154, + 159, 129, 98, 0, 5, - 206, + 211, 86, 91, 96, @@ -1977,12 +1980,12 @@ pub mod summa { 98, 0, 7, - 173, + 178, 129, 98, 0, 5, - 206, + 211, 86, 91, 96, @@ -2008,7 +2011,7 @@ pub mod summa { 98, 0, 7, - 203, + 208, 87, 96, 0, @@ -2018,7 +2021,7 @@ pub mod summa { 98, 0, 7, - 217, + 222, 139, 131, 140, @@ -2026,7 +2029,7 @@ pub mod summa { 98, 0, 6, - 45, + 50, 86, 91, 148, @@ -2045,7 +2048,7 @@ pub mod summa { 98, 0, 7, - 240, + 245, 87, 96, 0, @@ -2055,8 +2058,8 @@ pub mod summa { 80, 98, 0, - 7, - 255, + 8, + 4, 138, 130, 139, @@ -2064,7 +2067,7 @@ pub mod summa { 98, 0, 6, - 45, + 50, 86, 91, 146, @@ -2084,7 +2087,7 @@ pub mod summa { 98, 0, 8, - 23, + 28, 87, 96, 0, @@ -2160,16 +2163,16 @@ pub mod summa { 98, 0, 8, - 104, + 109, 87, 98, 0, 8, - 104, + 109, 98, 0, 8, - 61, + 66, 86, 91, 80, @@ -2189,7 +2192,7 @@ pub mod summa { 98, 0, 8, - 145, + 150, 87, 99, 78, @@ -2242,16 +2245,16 @@ pub mod summa { 98, 0, 8, - 186, + 191, 87, 98, 0, 8, - 186, + 191, 98, 0, 8, - 61, + 66, 86, 91, 146, @@ -2270,16 +2273,16 @@ pub mod summa { 98, 0, 8, - 186, + 191, 87, 98, 0, 8, - 186, + 191, 98, 0, 8, - 61, + 66, 86, 91, 129, @@ -2292,16 +2295,16 @@ pub mod summa { 98, 0, 8, - 186, + 191, 87, 98, 0, 8, - 186, + 191, 98, 0, 8, - 61, + 66, 86, 91, 96, @@ -2316,7 +2319,7 @@ pub mod summa { 98, 0, 9, - 1, + 6, 87, 96, 127, @@ -2334,7 +2337,7 @@ pub mod summa { 98, 0, 9, - 34, + 39, 87, 99, 78, @@ -2372,7 +2375,7 @@ pub mod summa { 98, 0, 9, - 118, + 123, 87, 96, 0, @@ -2400,7 +2403,7 @@ pub mod summa { 98, 0, 9, - 81, + 86, 87, 80, 128, @@ -2424,7 +2427,7 @@ pub mod summa { 98, 0, 9, - 114, + 119, 87, 130, 129, @@ -2435,7 +2438,7 @@ pub mod summa { 98, 0, 9, - 93, + 98, 86, 91, 80, @@ -2463,40 +2466,40 @@ pub mod summa { 98, 0, 9, - 151, + 156, 87, 98, 0, 9, - 151, + 156, 98, 0, 5, - 228, + 233, 86, 91, 98, 0, 9, - 175, + 180, 129, 98, 0, 9, - 168, + 173, 132, 84, 98, 0, 8, - 236, + 241, 86, 91, 132, 98, 0, 9, - 40, + 45, 86, 91, 96, @@ -2513,7 +2516,7 @@ pub mod summa { 98, 0, 9, - 231, + 236, 87, 96, 0, @@ -2522,7 +2525,7 @@ pub mod summa { 98, 0, 9, - 206, + 211, 87, 80, 133, @@ -2552,7 +2555,7 @@ pub mod summa { 98, 0, 9, - 114, + 119, 86, 91, 96, @@ -2578,7 +2581,7 @@ pub mod summa { 98, 0, 10, - 24, + 29, 87, 136, 134, @@ -2601,7 +2604,7 @@ pub mod summa { 98, 0, 9, - 247, + 252, 86, 91, 80, @@ -2612,7 +2615,7 @@ pub mod summa { 98, 0, 10, - 55, + 60, 87, 135, 133, @@ -2669,7 +2672,7 @@ pub mod summa { 98, 0, 10, - 150, + 155, 96, 0, 57, @@ -10456,38 +10459,38 @@ pub mod summa { 34, 18, 32, - 134, - 176, 92, - 129, - 176, - 246, - 11, - 26, - 49, - 238, - 104, - 196, 221, - 82, - 171, - 23, - 219, - 113, - 171, - 244, - 157, - 67, - 134, + 52, + 89, + 207, + 150, + 127, + 41, + 140, + 130, + 85, + 240, 216, - 115, + 57, + 88, + 45, + 199, + 221, + 65, + 85, + 82, + 48, + 245, + 20, + 33, + 144, + 31, + 96, 248, - 142, - 231, - 228, - 146, - 232, - 106, + 56, + 150, + 32, 100, 115, 111, @@ -10501,8 +10504,9 @@ pub mod summa { 51, ]; ///The bytecode of the contract. - pub static SUMMA_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); + pub static SUMMA_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static( + __BYTECODE, + ); #[rustfmt::skip] const __DEPLOYED_BYTECODE: &[u8] = &[ 96, @@ -18232,38 +18236,38 @@ pub mod summa { 34, 18, 32, - 134, - 176, 92, - 129, - 176, - 246, - 11, - 26, - 49, - 238, - 104, - 196, 221, - 82, - 171, - 23, - 219, - 113, - 171, - 244, - 157, - 67, - 134, + 52, + 89, + 207, + 150, + 127, + 41, + 140, + 130, + 85, + 240, 216, - 115, + 57, + 88, + 45, + 199, + 221, + 65, + 85, + 82, + 48, + 245, + 20, + 33, + 144, + 31, + 96, 248, - 142, - 231, - 228, - 146, - 232, - 106, + 56, + 150, + 32, 100, 115, 111, @@ -18277,8 +18281,9 @@ pub mod summa { 51, ]; ///The deployed bytecode of the contract. - pub static SUMMA_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); + pub static SUMMA_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static( + __DEPLOYED_BYTECODE, + ); pub struct Summa(::ethers::contract::Contract); impl ::core::clone::Clone for Summa { fn clone(&self) -> Self { @@ -18298,9 +18303,7 @@ pub mod summa { } impl ::core::fmt::Debug for Summa { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_tuple(stringify!(Summa)) - .field(&self.address()) - .finish() + f.debug_tuple(stringify!(Summa)).field(&self.address()).finish() } } impl Summa { @@ -18310,11 +18313,13 @@ pub mod summa { address: T, client: ::std::sync::Arc, ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - SUMMA_ABI.clone(), - client, - )) + Self( + ::ethers::contract::Contract::new( + address.into(), + SUMMA_ABI.clone(), + client, + ), + ) } /// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it. /// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction @@ -18376,7 +18381,10 @@ pub mod summa { pub fn commitments( &self, p0: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { + ) -> ::ethers::contract::builders::ContractCall< + M, + ::ethers::core::types::Bytes, + > { self.0 .method_hash([73, 206, 137, 151], p0) .expect("method not found (this should never happen)") @@ -18399,13 +18407,18 @@ pub mod summa { ///Calls the contract's `owner` (0x8da5cb5b) function pub fn owner( &self, - ) -> ::ethers::contract::builders::ContractCall { + ) -> ::ethers::contract::builders::ContractCall< + M, + ::ethers::core::types::Address, + > { self.0 .method_hash([141, 165, 203, 91], ()) .expect("method not found (this should never happen)") } ///Calls the contract's `renounceOwnership` (0x715018a6) function - pub fn renounce_ownership(&self) -> ::ethers::contract::builders::ContractCall { + pub fn renounce_ownership( + &self, + ) -> ::ethers::contract::builders::ContractCall { self.0 .method_hash([113, 80, 24, 166], ()) .expect("method not found (this should never happen)") @@ -18461,7 +18474,10 @@ pub mod summa { ///Calls the contract's `verifyingKey` (0x7950c5f8) function pub fn verifying_key( &self, - ) -> ::ethers::contract::builders::ContractCall { + ) -> ::ethers::contract::builders::ContractCall< + M, + ::ethers::core::types::Address, + > { self.0 .method_hash([121, 80, 197, 248], ()) .expect("method not found (this should never happen)") @@ -18489,19 +18505,22 @@ pub mod summa { ///Gets the contract's `OwnershipTransferred` event pub fn ownership_transferred_filter( &self, - ) -> ::ethers::contract::builders::Event<::std::sync::Arc, M, OwnershipTransferredFilter> - { + ) -> ::ethers::contract::builders::Event< + ::std::sync::Arc, + M, + OwnershipTransferredFilter, + > { self.0.event() } /// Returns an `Event` builder for all the events of this contract. pub fn events( &self, ) -> ::ethers::contract::builders::Event<::std::sync::Arc, M, SummaEvents> { - self.0 - .event_with_filter(::core::default::Default::default()) + self.0.event_with_filter(::core::default::Default::default()) } } - impl From<::ethers::contract::Contract> for Summa { + impl From<::ethers::contract::Contract> + for Summa { fn from(contract: ::ethers::contract::Contract) -> Self { Self::new(contract.address(), contract.client()) } @@ -18514,7 +18533,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethevent( name = "AddressOwnershipProofSubmitted", @@ -18531,7 +18550,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethevent( name = "LiabilitiesCommitmentSubmitted", @@ -18552,7 +18571,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethevent( name = "OwnershipTransferred", @@ -18596,7 +18615,9 @@ pub mod summa { Self::LiabilitiesCommitmentSubmittedFilter(element) => { ::core::fmt::Display::fmt(element, f) } - Self::OwnershipTransferredFilter(element) => ::core::fmt::Display::fmt(element, f), + Self::OwnershipTransferredFilter(element) => { + ::core::fmt::Display::fmt(element, f) + } } } } @@ -18624,12 +18645,9 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, - )] - #[ethcall( - name = "addressOwnershipProofs", - abi = "addressOwnershipProofs(uint256)" + Hash )] + #[ethcall(name = "addressOwnershipProofs", abi = "addressOwnershipProofs(uint256)")] pub struct AddressOwnershipProofsCall(pub ::ethers::core::types::U256); ///Container type for all input parameters for the `commitments` function with signature `commitments(uint256)` and selector `0x49ce8997` #[derive( @@ -18640,7 +18658,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall(name = "commitments", abi = "commitments(uint256)")] pub struct CommitmentsCall(pub ::ethers::core::types::U256); @@ -18653,7 +18671,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall(name = "config", abi = "config()")] pub struct ConfigCall; @@ -18666,7 +18684,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall( name = "getAddressOwnershipProof", @@ -18684,7 +18702,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall(name = "owner", abi = "owner()")] pub struct OwnerCall; @@ -18697,7 +18715,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")] pub struct RenounceOwnershipCall; @@ -18710,7 +18728,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall( name = "submitCommitment", @@ -18731,7 +18749,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall( name = "submitProofOfAddressOwnership", @@ -18749,7 +18767,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall(name = "transferOwnership", abi = "transferOwnership(address)")] pub struct TransferOwnershipCall { @@ -18764,7 +18782,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall( name = "verifyInclusionProof", @@ -18785,7 +18803,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] #[ethcall(name = "verifyingKey", abi = "verifyingKey()")] pub struct VerifyingKeyCall; @@ -18809,52 +18827,62 @@ pub mod summa { data: impl AsRef<[u8]>, ) -> ::core::result::Result { let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::AddressOwnershipProofs(decoded)); } - if let Ok(decoded) = ::decode(data) { + if let Ok(decoded) + = ::decode(data) { return Ok(Self::Commitments(decoded)); } - if let Ok(decoded) = ::decode(data) { + if let Ok(decoded) + = ::decode(data) { return Ok(Self::Config(decoded)); } - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::GetAddressOwnershipProof(decoded)); } - if let Ok(decoded) = ::decode(data) { + if let Ok(decoded) + = ::decode(data) { return Ok(Self::Owner(decoded)); } - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::RenounceOwnership(decoded)); } - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::SubmitCommitment(decoded)); } - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::SubmitProofOfAddressOwnership(decoded)); } - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::TransferOwnership(decoded)); } - if let Ok(decoded) = - ::decode(data) - { + if let Ok(decoded) + = ::decode( + data, + ) { return Ok(Self::VerifyInclusionProof(decoded)); } - if let Ok(decoded) = ::decode(data) - { + if let Ok(decoded) + = ::decode(data) { return Ok(Self::VerifyingKey(decoded)); } Err(::ethers::core::abi::Error::InvalidData.into()) @@ -18866,32 +18894,46 @@ pub mod summa { Self::AddressOwnershipProofs(element) => { ::ethers::core::abi::AbiEncode::encode(element) } - Self::Commitments(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::Commitments(element) => { + ::ethers::core::abi::AbiEncode::encode(element) + } Self::Config(element) => ::ethers::core::abi::AbiEncode::encode(element), Self::GetAddressOwnershipProof(element) => { ::ethers::core::abi::AbiEncode::encode(element) } Self::Owner(element) => ::ethers::core::abi::AbiEncode::encode(element), - Self::RenounceOwnership(element) => ::ethers::core::abi::AbiEncode::encode(element), - Self::SubmitCommitment(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::RenounceOwnership(element) => { + ::ethers::core::abi::AbiEncode::encode(element) + } + Self::SubmitCommitment(element) => { + ::ethers::core::abi::AbiEncode::encode(element) + } Self::SubmitProofOfAddressOwnership(element) => { ::ethers::core::abi::AbiEncode::encode(element) } - Self::TransferOwnership(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::TransferOwnership(element) => { + ::ethers::core::abi::AbiEncode::encode(element) + } Self::VerifyInclusionProof(element) => { ::ethers::core::abi::AbiEncode::encode(element) } - Self::VerifyingKey(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::VerifyingKey(element) => { + ::ethers::core::abi::AbiEncode::encode(element) + } } } } impl ::core::fmt::Display for SummaCalls { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { match self { - Self::AddressOwnershipProofs(element) => ::core::fmt::Display::fmt(element, f), + Self::AddressOwnershipProofs(element) => { + ::core::fmt::Display::fmt(element, f) + } Self::Commitments(element) => ::core::fmt::Display::fmt(element, f), Self::Config(element) => ::core::fmt::Display::fmt(element, f), - Self::GetAddressOwnershipProof(element) => ::core::fmt::Display::fmt(element, f), + Self::GetAddressOwnershipProof(element) => { + ::core::fmt::Display::fmt(element, f) + } Self::Owner(element) => ::core::fmt::Display::fmt(element, f), Self::RenounceOwnership(element) => ::core::fmt::Display::fmt(element, f), Self::SubmitCommitment(element) => ::core::fmt::Display::fmt(element, f), @@ -18899,7 +18941,9 @@ pub mod summa { ::core::fmt::Display::fmt(element, f) } Self::TransferOwnership(element) => ::core::fmt::Display::fmt(element, f), - Self::VerifyInclusionProof(element) => ::core::fmt::Display::fmt(element, f), + Self::VerifyInclusionProof(element) => { + ::core::fmt::Display::fmt(element, f) + } Self::VerifyingKey(element) => ::core::fmt::Display::fmt(element, f), } } @@ -18968,7 +19012,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct AddressOwnershipProofsReturn { pub cex_address: ::std::string::String, @@ -18985,7 +19029,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct CommitmentsReturn(pub ::ethers::core::types::Bytes); ///Container type for all return fields from the `config` function with signature `config()` and selector `0x79502c55` @@ -18997,7 +19041,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct ConfigReturn { pub balance_byte_range: u8, @@ -19011,7 +19055,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct GetAddressOwnershipProofReturn(pub AddressOwnershipProof); ///Container type for all return fields from the `owner` function with signature `owner()` and selector `0x8da5cb5b` @@ -19023,7 +19067,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct OwnerReturn(pub ::ethers::core::types::Address); ///Container type for all return fields from the `verifyInclusionProof` function with signature `verifyInclusionProof(uint256,bytes,uint256[],uint256[])` and selector `0x9c382559` @@ -19035,7 +19079,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct VerifyInclusionProofReturn(pub bool); ///Container type for all return fields from the `verifyingKey` function with signature `verifyingKey()` and selector `0x7950c5f8` @@ -19047,7 +19091,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct VerifyingKeyReturn(pub ::ethers::core::types::Address); ///`AddressOwnershipProof(string,string,bytes,bytes)` @@ -19059,7 +19103,7 @@ pub mod summa { Debug, PartialEq, Eq, - Hash, + Hash )] pub struct AddressOwnershipProof { pub cex_address: ::std::string::String, diff --git a/backend/src/tests.rs b/backend/src/tests.rs index d349ccf1..7d8a918c 100644 --- a/backend/src/tests.rs +++ b/backend/src/tests.rs @@ -150,7 +150,7 @@ mod test { const K: u32 = 17; const N_CURRENCIES: usize = 2; - const N_POINTS: usize = 3; + const N_POINTS: usize = N_CURRENCIES + 1; const N_USERS: usize = 16; const PARAMS_PATH: &str = "../backend/ptau/hermez-raw-17"; diff --git a/contracts/src/Summa.sol b/contracts/src/Summa.sol index 96399bf4..b92d83ab 100644 --- a/contracts/src/Summa.sol +++ b/contracts/src/Summa.sol @@ -50,8 +50,8 @@ contract Summa is Ownable { // Convenience mapping to check if an address has already been verified mapping(bytes32 => uint256) private _ownershipProofByAddress; - // zkSNARK verifier of the valid polynomial encoding - IVerifier private immutable polynomialEncodingVerifier; + // zkSNARK verifier of the valid polynomial interpolation + IVerifier private immutable polynomialInterpolationVerifier; // KZG verifier of the grand sum IVerifier private immutable grandSumVerifier; @@ -72,7 +72,7 @@ contract Summa is Ownable { /** * Summa contract * @param _verifyingKey The address of the verification key contract - * @param _polynomialEncodingVerifier the address of the polynomial encoding zkSNARK verifier + * @param _polynomialInterpolationVerifier the address of the polynomial interpolation zkSNARK verifier * @param _grandSumVerifier the address of the grand sum KZG verifier * @param _inclusionVerifier the address of the inclusion KZG verifier * @param cryptocurrencyNames the names of the cryptocurrencies whose balances are encoded in the polynomials @@ -81,7 +81,7 @@ contract Summa is Ownable { */ constructor( address _verifyingKey, - IVerifier _polynomialEncodingVerifier, + IVerifier _polynomialInterpolationVerifier, IVerifier _grandSumVerifier, IInclusionVerifier _inclusionVerifier, string[] memory cryptocurrencyNames, @@ -110,10 +110,10 @@ contract Summa is Ownable { "The config parameters do not correspond to the verifying key" ); require( - address(_polynomialEncodingVerifier) != address(0), - "Invalid polynomial encoding verifier address" + address(_polynomialInterpolationVerifier) != address(0), + "Invalid polynomial interpolation verifier address" ); - polynomialEncodingVerifier = _polynomialEncodingVerifier; + polynomialInterpolationVerifier = _polynomialInterpolationVerifier; require( address(_grandSumVerifier) != address(0), "Invalid grand sum verifier address" @@ -216,7 +216,7 @@ contract Summa is Ownable { /** * @dev Submit commitment for a CEX - * @param snarkProof ZK proof of the valid polynomial encoding + * @param snarkProof ZK proof of the valid polynomial interpolation * @param grandSumProof kzg proof of the grand sum * @param totalBalances The array of total balances in the grand sum * @param timestamp The timestamp at which the CEX took the snapshot of its assets and liabilities @@ -235,7 +235,7 @@ contract Summa is Ownable { uint[] memory args = new uint[](1); args[0] = 1; // Workaround to satisfy the verifier (TODO remove after https://github.com/summa-dev/halo2-solidity-verifier/issues/1 is resolved) require( - polynomialEncodingVerifier.verifyProof(verifyingKey, snarkProof, args), + polynomialInterpolationVerifier.verifyProof(verifyingKey, snarkProof, args), "Invalid snark proof" ); require( diff --git a/contracts/test/Summa.ts b/contracts/test/Summa.ts index 56d49146..8b542df4 100644 --- a/contracts/test/Summa.ts +++ b/contracts/test/Summa.ts @@ -165,7 +165,7 @@ describe("Summa Contract", () => { ["ETH", "BTC"], 8, ]) - ).to.be.revertedWith("Invalid polynomial encoding verifier address"); + ).to.be.revertedWith("Invalid polynomial interpolation verifier address"); }); diff --git a/kzg_prover/README.md b/kzg_prover/README.md index 016bf95c..7e87544d 100644 --- a/kzg_prover/README.md +++ b/kzg_prover/README.md @@ -1,12 +1,12 @@ -# Summa V2: Polynomial Encoding Approach +# Summa V2: Polynomial Interpolation Approach ## Motivation -[Summa V1](https://github.com/summa-dev/summa-solvency/releases/tag/merkle_sum_tree_v1.1) was using a Merkle sum tree (MST) as the main data structure and a cryptographic commitment. MST that has $n$ leaves involves $2n-1$ hashing operations, making it computationally demanding. Additionally, the MST inclusion proofs in Summa V1 have to be wrapped into a ZK-SNARK, making it infeasible to generate all of them at once for the entire user base of the Custodian (~100M users). +[Summa V1](https://github.com/summa-dev/summa-solvency/releases/tag/merkle_sum_tree_v1.1.1) was using a Merkle sum tree (MST) as the main data structure and a cryptographic commitment. MST that has $n$ leaves involves $2n-1$ hashing operations, making it computationally demanding. Additionally, the MST inclusion proofs in Summa V1 have to be wrapped into a ZK-SNARK, making it infeasible to generate all of them at once for the entire user base of the Custodian (~100M users). ## Univariate Grand Sum Calculation -The grand total of all the Custodian's $n$ user cryptocurrency balances is the Custodian's liabilities $S$. Summa V2 is using a property of the _sum of all roots of unity in a finite field_ being _equal to zero_ to find the liabilities. This property allows to efficiently calculate the grand sum of univariate polynomial evaluations. Summa V2 takes advantage of that by encoding the user balances into a univariate polynomial in a special way. The resulting proof of solvency protocol has the following steps: +The grand total of all the Custodian's $n$ user cryptocurrency balances is the Custodian's liabilities $S$. Summa V2 is using a property of the _sum of all roots of unity in a finite field_ being _equal to zero_ to find the liabilities. This property allows to efficiently calculate the grand sum of univariate polynomial evaluations. Summa V2 takes advantage of that by interpolating the user balances into a univariate polynomial in a special way. The resulting proof of solvency protocol has the following steps: 1. construct a polynomial of degree $d = n - 1$ that interpolates the points $(\omega^i, b_i)$ where $i \in 0..n-1$ is the user index, $\omega^i$ is the power of an $n$-th primitive root of unity ($x$ value), and $b_i$ is the $i$-th user balance value ($y$ value); 2. multiply the constant term $a_0$ of the polynomial by $n$ to obtain the grand sum: @@ -27,7 +27,7 @@ The algorithm works as follows: 1. Assign all the user balances to an unblinded advice column of the [circuit](../kzg_prover/src/circuits/univariate_grand_sum.rs). The unblinded advice column is a special kind of advice column without the random values (blinding factors) added at the bottom. The constant term of such polynomial correctly yields the grand total of user balances according to (1) because the polynomial only interpolates the user balances but not the blinding factors (as in the case with a normal advice column). 2. Assign the user IDs (e.g., hashes of user emails) to another (normal) advice column. -3. Generate the ZK-SNARK proof for the circuit, effectively encoding the balance values into a polynomial and performing a KZG commitment to this polynomial. +3. Generate the ZK-SNARK proof for the circuit, effectively interpolating the balance values into a polynomial and performing a KZG commitment to this polynomial. 4. Perform a KZG opening proof of the polynomial at $x=0$ and publicly reveal the constant term $a_0$ of the polynomial. The public can then calculate the liabilities by multiplying the $a_0$ by $d + 1$ where $d$ is the polynomial degree. 5. Privately provide to each user a KZG proof of the corresponding user opening (namely, the openings of the user ID and balance polynomials). Cross-checking the balance opening and the user ID opening $\omega^i$ value ensures that no malicious Custodian can provide the same balance opening to multiple users with the identical balance value. diff --git a/kzg_prover/benches/kzg.rs b/kzg_prover/benches/kzg.rs index e88f4a00..c883d035 100644 --- a/kzg_prover/benches/kzg.rs +++ b/kzg_prover/benches/kzg.rs @@ -20,7 +20,7 @@ use summa_solvency::{ }, cryptocurrency::Cryptocurrency, entry::Entry, - utils::{big_uint_to_fp, parse_csv_to_entries}, + utils::{big_uint_to_fp, generate_dummy_entries}, }; fn bench_kzg< @@ -31,7 +31,6 @@ fn bench_kzg< CONFIG: CircuitConfig, >( name: &str, - csv_path: &str, ) where [(); N_CURRENCIES + 1]:, { @@ -57,9 +56,7 @@ fn bench_kzg< let verifying_grand_sum_bench_name = format!("<{}> verifying grand sum", name); let verifying_user_bench_name = format!("<{}> verifying user inclusion", name); - let mut entries: Vec> = vec![Entry::init_empty(); N_USERS]; - let mut cryptos = vec![Cryptocurrency::init_empty(); N_CURRENCIES]; - parse_csv_to_entries::<&str, N_CURRENCIES>(csv_path, &mut entries, &mut cryptos).unwrap(); + let entries = generate_dummy_entries::().unwrap(); // Calculate total for all entry columns let mut csv_total: Vec = vec![BigUint::from(0u32); N_CURRENCIES]; @@ -261,75 +258,65 @@ fn bench_kzg< } fn criterion_benchmark(_c: &mut Criterion) { - const N_CURRENCIES: usize = 2; - const N_POINTS: usize = 3; + const N_CURRENCIES: usize = 1; + const N_POINTS: usize = N_CURRENCIES + 1; // Demonstrating that a higher value of K has a more significant impact on benchmark performance than the number of users #[cfg(not(feature = "no_range_check"))] { - const K: u32 = 18; - const N_USERS: usize = 16; + const K: u32 = 17; + const N_USERS: usize = 2usize.pow(K) + 2usize.pow(16) - 6; // Subtracting 2^16 (reserved for range checks) and 6 (reserved rows) from 2^K. bench_kzg::< K, N_USERS, N_CURRENCIES, N_POINTS, UnivariateGrandSumConfig, - >( - format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str(), - format!("../csv/entry_{N_USERS}.csv").as_str(), - ); + >(format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str()); } #[cfg(not(feature = "no_range_check"))] { - const K: u32 = 17; - const N_USERS: usize = 64; + const K: u32 = 18; + const N_USERS: usize = 2usize.pow(K) - 2usize.pow(16) - 6; // Subtracting 2^16 (reserved for range checks) and 6 (reserved rows) from 2^K. bench_kzg::< K, N_USERS, N_CURRENCIES, N_POINTS, UnivariateGrandSumConfig, - >( - format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str(), - format!("../csv/entry_{N_USERS}.csv").as_str(), - ); + >(format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str()); } //Use the following benchmarks for quick evaluation/prototyping (no range check) #[cfg(feature = "no_range_check")] { const K: u32 = 9; - const N_USERS: usize = 64; + const N_USERS: usize = 2usize.pow(K) - 6; bench_kzg::>( format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str(), - format!("../csv/entry_{N_USERS}.csv").as_str(), ); } #[cfg(feature = "no_range_check")] { const K: u32 = 10; - const N_USERS: usize = 64; + const N_USERS: usize = 2usize.pow(K) - 6; bench_kzg::>( format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str(), - format!("../csv/entry_{N_USERS}.csv").as_str(), ); } #[cfg(feature = "no_range_check")] { const K: u32 = 11; - const N_USERS: usize = 64; + const N_USERS: usize = 2usize.pow(K) - 6; bench_kzg::>( format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str(), - format!("../csv/entry_{N_USERS}.csv").as_str(), ); } #[cfg(feature = "no_range_check")] { const K: u32 = 12; - const N_USERS: usize = 64; + const N_USERS: usize = 2usize.pow(K) - 6; bench_kzg::>( format!("K = {K}, N_USERS = {N_USERS}, N_CURRENCIES = {N_CURRENCIES}").as_str(), - format!("../csv/entry_{N_USERS}.csv").as_str(), ); } } diff --git a/kzg_prover/src/circuits/tests.rs b/kzg_prover/src/circuits/tests.rs index 85b888c9..b1a5b4d7 100644 --- a/kzg_prover/src/circuits/tests.rs +++ b/kzg_prover/src/circuits/tests.rs @@ -25,7 +25,7 @@ mod test { const K: u32 = 17; const N_CURRENCIES: usize = 2; - const N_POINTS: usize = 3; + const N_POINTS: usize = N_CURRENCIES + 1; const N_USERS: usize = 16; #[test] diff --git a/kzg_prover/src/entry.rs b/kzg_prover/src/entry.rs index 742bd05d..daaef76c 100644 --- a/kzg_prover/src/entry.rs +++ b/kzg_prover/src/entry.rs @@ -5,14 +5,14 @@ use crate::utils::big_intify_username; /// An entry in the Merkle Sum Tree from the database of the CEX. /// It contains the username and the balances of the user. #[derive(Clone, Debug)] -pub struct Entry { +pub struct Entry { username_as_big_uint: BigUint, - balances: [BigUint; N_ASSETS], + balances: [BigUint; N_CURRENCIES], username: String, } -impl Entry { - pub fn new(username: String, balances: [BigUint; N_ASSETS]) -> Result { +impl Entry { + pub fn new(username: String, balances: [BigUint; N_CURRENCIES]) -> Result { Ok(Entry { username_as_big_uint: big_intify_username(&username), balances, @@ -21,7 +21,7 @@ impl Entry { } pub fn init_empty() -> Self { - let empty_balances: [BigUint; N_ASSETS] = std::array::from_fn(|_| BigUint::from(0u32)); + let empty_balances: [BigUint; N_CURRENCIES] = std::array::from_fn(|_| BigUint::from(0u32)); Entry { username_as_big_uint: BigUint::from(0u32), @@ -30,7 +30,7 @@ impl Entry { } } - pub fn balances(&self) -> &[BigUint; N_ASSETS] { + pub fn balances(&self) -> &[BigUint; N_CURRENCIES] { &self.balances } diff --git a/kzg_prover/src/utils/csv_parser.rs b/kzg_prover/src/utils/csv_parser.rs index daf37142..43b34895 100644 --- a/kzg_prover/src/utils/csv_parser.rs +++ b/kzg_prover/src/utils/csv_parser.rs @@ -7,9 +7,9 @@ use std::path::Path; use crate::cryptocurrency::Cryptocurrency; use crate::entry::Entry; -pub fn parse_csv_to_entries, const N_ASSETS: usize>( +pub fn parse_csv_to_entries, const N_CURRENCIES: usize>( path: P, - entries: &mut [Entry], + entries: &mut [Entry], cryptocurrencies: &mut [Cryptocurrency], ) -> Result<(), Box> { let file = File::open(path)?; @@ -39,7 +39,7 @@ pub fn parse_csv_to_entries, const N_ASSETS: usize>( } } - let mut balances_acc: Vec = vec![BigUint::from(0_usize); N_ASSETS]; + let mut balances_acc: Vec = vec![BigUint::from(0_usize); N_CURRENCIES]; for (i, result) in rdr.deserialize().enumerate() { let record: HashMap = result?; diff --git a/kzg_prover/src/utils/dummy_entries.rs b/kzg_prover/src/utils/dummy_entries.rs new file mode 100644 index 00000000..c01d74dc --- /dev/null +++ b/kzg_prover/src/utils/dummy_entries.rs @@ -0,0 +1,63 @@ +use num_bigint::BigUint; +use rand::{distributions::Alphanumeric, Rng}; +use rayon::prelude::*; +use std::error::Error; + +use crate::entry::Entry; + +// This is for testing purposes with a large dataset instead of using a CSV file +pub fn generate_dummy_entries(// entries: &mut [Entry], + // cryptocurrencies: &mut [Cryptocurrency], +) -> Result>, Box> { + // Ensure N_CURRENCIES is greater than 0. + if N_CURRENCIES == 0 { + return Err("N_CURRENCIES must be greater than 0".into()); + } + + let mut entries: Vec> = vec![Entry::init_empty(); N_USERS]; + + entries.par_iter_mut().for_each(|entry| { + let mut rng = rand::thread_rng(); + + let username: String = (0..10).map(|_| rng.sample(Alphanumeric) as char).collect(); + + let balances: [BigUint; N_CURRENCIES] = + std::array::from_fn(|_| BigUint::from(rng.gen_range(1000..90000) as u32)); + + *entry = Entry::new(username, balances).expect("Failed to create entry"); + }); + + Ok(entries) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::cryptocurrency::Cryptocurrency; + use crate::entry::Entry; + + #[test] + fn test_generate_random_entries() { + const N_USERS: usize = 1 << 17; + const N_CURRENCIES: usize = 2; + + // Attempt to generate random entries + let entries = generate_dummy_entries::().unwrap(); + + // Verify that entries are populated + assert_eq!(entries.len(), N_USERS); + for entry in entries { + assert!(!entry.username().is_empty()); + assert_eq!(entry.balances().len(), N_CURRENCIES); + } + } + + #[test] + fn test_asset_not_zero() { + const N_USERS: usize = 1 << 17; + const N_CURRENCIES: usize = 0; + + // `N_CURRENCIES` is zero, so this should fail + assert!(generate_dummy_entries::().is_err()); + } +} diff --git a/kzg_prover/src/utils/mod.rs b/kzg_prover/src/utils/mod.rs index d2437ee7..3cd0bfc8 100644 --- a/kzg_prover/src/utils/mod.rs +++ b/kzg_prover/src/utils/mod.rs @@ -1,6 +1,8 @@ pub mod amortized_kzg; mod csv_parser; +mod dummy_entries; mod operation_helpers; pub use csv_parser::parse_csv_to_entries; +pub use dummy_entries::generate_dummy_entries; pub use operation_helpers::*;