diff --git a/backend/examples/summa_solvency_flow.rs b/backend/examples/summa_solvency_flow.rs index a584bd44..8fa58c1b 100644 --- a/backend/examples/summa_solvency_flow.rs +++ b/backend/examples/summa_solvency_flow.rs @@ -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..43a7c755 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":"_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":"0x6101006040523480156200001257600080fd5b50604051620028f5380380620028f5833981016040819052620000359162000750565b62000040336200042a565b6001600160a01b0387166200009c5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420766572696679696e67206b6579206164647265737300000060448201526064015b60405180910390fd5b6001600160a01b0387166080528151835114620001145760405162461bcd60e51b815260206004820152602f60248201527f43727970746f63757272656e6379206e616d657320616e6420636861696e732060448201526e0dceadac4cae440dad2e6dac2e8c6d608b1b606482015260840162000093565b60005b8351811015620001d1578381815181106200013657620001366200082c565b6020026020010151516000141580156200016e57508281815181106200016057620001606200082c565b602002602001015151600014155b620001bc5760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642063727970746f63757272656e637900000000000000000000604482015260640162000093565b80620001c88162000858565b91505062000117565b50620001e6878451836200047a60201b60201c565b6200025a5760405162461bcd60e51b815260206004820152603c60248201527f54686520636f6e66696720706172616d657465727320646f206e6f7420636f7260448201527f726573706f6e6420746f2074686520766572696679696e67206b657900000000606482015260840162000093565b6001600160a01b038616620002cc5760405162461bcd60e51b815260206004820152603160248201527f496e76616c696420706f6c796e6f6d69616c20696e746572706f6c6174696f6e604482015270207665726966696572206164647265737360781b606482015260840162000093565b6001600160a01b0380871660a0528516620003355760405162461bcd60e51b815260206004820152602260248201527f496e76616c6964206772616e642073756d207665726966696572206164647265604482015261737360f01b606482015260840162000093565b6001600160a01b0380861660c05284166200039e5760405162461bcd60e51b815260206004820152602260248201527f496e76616c696420696e636c7573696f6e207665726966696572206164647265604482015261737360f01b606482015260840162000093565b6001600160a01b03841660e05260408051606081018252848152602080820185905260ff84169282019290925284519091600191620003e391839190880190620004fc565b506020828101518051620003fe9260018501920190620004fc565b50604091909101516002909101805460ff191660ff9092169190911790555062000a4c95505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080836200048b60028562000874565b60ff166200049a9190620008a5565b620004a7906002620008c5565b90506102e06000620004bb836040620008a5565b620004c79083620008c5565b90506000620004d8601083620008db565b9050600060208260008b3c5050600051600f81161590151916979650505050505050565b82805482825590600052602060002090810192821562000547579160200282015b8281111562000547578251829062000536908262000980565b50916020019190600101906200051d565b506200055592915062000559565b5090565b80821115620005555760006200057082826200057a565b5060010162000559565b5080546200058890620008f1565b6000825580601f1062000599575050565b601f016020900490600052602060002090810190620005b99190620005bc565b50565b5b80821115620005555760008155600101620005bd565b6001600160a01b0381168114620005b957600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200062a576200062a620005e9565b604052919050565b6000601f83818401126200064557600080fd5b825160206001600160401b0380831115620006645762000664620005e9565b8260051b62000675838201620005ff565b93845286810183019383810190898611156200069057600080fd5b84890192505b858310156200074357825184811115620006b05760008081fd5b8901603f81018b13620006c35760008081fd5b8581015185811115620006da57620006da620005e9565b620006ed818a01601f19168801620005ff565b81815260408d81848601011115620007055760008081fd5b60005b8381101562000725578481018201518382018b0152890162000708565b50506000918101880191909152835250918401919084019062000696565b9998505050505050505050565b600080600080600080600060e0888a0312156200076c57600080fd5b87516200077981620005d3565b60208901519097506200078c81620005d3565b60408901519096506200079f81620005d3565b6060890151909550620007b281620005d3565b60808901519094506001600160401b0380821115620007d057600080fd5b620007de8b838c0162000632565b945060a08a0151915080821115620007f557600080fd5b50620008048a828b0162000632565b92505060c088015160ff811681146200081c57600080fd5b8091505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200086d576200086d62000842565b5060010190565b600060ff8316806200089657634e487b7160e01b600052601260045260246000fd5b8060ff84160491505092915050565b8082028115828204841417620008bf57620008bf62000842565b92915050565b80820180821115620008bf57620008bf62000842565b81810381811115620008bf57620008bf62000842565b600181811c908216806200090657607f821691505b6020821081036200092757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200097b57600081815260208120601f850160051c81016020861015620009565750805b601f850160051c820191505b81811015620009775782815560010162000962565b5050505b505050565b81516001600160401b038111156200099c576200099c620005e9565b620009b481620009ad8454620008f1565b846200092d565b602080601f831160018114620009ec5760008415620009d35750858301515b600019600386901b1c1916600185901b17855562000977565b600085815260208120601f198616915b8281101562000a1d57888601518255948401946001909101908401620009fc565b508582101562000a3c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e051611e5a62000a9b6000396000610cb801526000610514015260006103500152600081816101380152818161037d015281816105410152610ce50152611e5a6000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80637950c5f8116100715780637950c5f8146101335780638da5cb5b146101725780639c38255914610183578063a3c4bcf8146101a6578063c7ddca0e146101c9578063f2fde38b146101dc57600080fd5b806305ab9860146100ae57806319b33968146100c357806349ce8997146100ec578063715018a61461010c57806379502c5514610114575b600080fd5b6100c16100bc3660046114cb565b6101ef565b005b6100d66100d1366004611567565b610660565b6040516100e3919061163b565b60405180910390f35b6100ff6100fa366004611567565b610973565b6040516100e39190611655565b6100c1610a0d565b6003546101219060ff1681565b60405160ff90911681526020016100e3565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100e3565b6000546001600160a01b031661015a565b6101966101913660046116d8565b610a21565b60405190151581526020016100e3565b6101b96101b4366004611567565b610d5f565b6040516100e3949392919061176a565b6100c16101d73660046117b7565b610fbf565b6100c16101ea366004611911565b611260565b6101f76112d9565b600082511161024d5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420746f74616c2062616c616e636573206c656e67746800000060448201526064015b60405180910390fd5b815161025a906040611950565b83146102a85760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964206772616e642073756d2070726f6f66206c656e67746800006044820152606401610244565b8285116102f75760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736e61726b2070726f6f66206c656e6774680000000000006044820152606401610244565b6040805160018082528183019092526000916020808301908036833701905050905060018160008151811061032e5761032e61196d565b602090810291909101015260405163af83a18d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d906103ab907f0000000000000000000000000000000000000000000000000000000000000000908b908b9087906004016119e7565b602060405180830381865afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec9190611a1e565b61042e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21039b730b93590383937b7b360691b6044820152606401610244565b6001548351146104a65760405162461bcd60e51b815260206004820152603a60248201527f4c696162696c69747920636f6d6d69746d656e747320616e642063727970746f60448201527f63757272656e63696573206e756d626572206d69736d617463680000000000006064820152608401610244565b3660008881896104b7896040611a40565b926104c493929190611a53565b9092509050600087876104da8460408188611a53565b6040516020016104ed9493929190611a7d565b60408051601f198184030181529082905263af83a18d60e01b825291506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d9061056d907f00000000000000000000000000000000000000000000000000000000000000009085908b90600401611a9f565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611a1e565b6105fa5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206772616e642073756d2070726f6f660000000000000000006044820152606401610244565b6000858152600560205260409020610613838583611b68565b50847f7603a12a8838a565715ddb5bbf625b3f00a5e6f4793437537963e30c3b9495dc8785858c8c60405161064c959493929190611c29565b60405180910390a250505050505050505050565b61068b6040518060800160405280606081526020016060815260200160608152602001606081525090565b6000828152600660205260409020546106dd5760405162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b6044820152606401610244565b6000828152600660205260409020546004906106fb90600190611c70565b8154811061070b5761070b61196d565b906000526020600020906004020160405180608001604052908160008201805461073490611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611adf565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b505050505081526020016001820180546107c690611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546107f290611adf565b801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b5050505050815260200160028201805461085890611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461088490611adf565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020016003820180546108ea90611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461091690611adf565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050815250509050919050565b6005602052600090815260409020805461098c90611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890611adf565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b610a156112d9565b610a1f6000611333565b565b60008251600414610a745760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206368616c6c656e676573206c656e677468000000000000006044820152606401610244565b6001805483519091610a8591611c70565b14610add5760405162461bcd60e51b815260206004820152602260248201527f56616c756573206c656e677468206d69736d61746368207769746820636f6e66604482015261696760f01b6064820152608401610244565b60008581526005602052604081208054610af690611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290611adf565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b50505050509050600085518251610b869190611a40565b67ffffffffffffffff811115610b9e57610b9e6113cc565b6040519080825280601f01601f191660200182016040528015610bc8576020820181803683370190505b50905060005b8651811015610c2f57868181518110610be957610be961196d565b602001015160f81c60f81b828281518110610c0657610c0661196d565b60200101906001600160f81b031916908160001a90535080610c2781611c83565b915050610bce565b5060005b8251811015610ca057828181518110610c4e57610c4e61196d565b602001015160f81c60f81b82885183610c679190611a40565b81518110610c7757610c7761196d565b60200101906001600160f81b031916908160001a90535080610c9881611c83565b915050610c33565b506040516323fb5ad560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906347f6b5aa90610d13907f00000000000000000000000000000000000000000000000000000000000000009085908a908a90600401611c9c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d549190611a1e565b979650505050505050565b60048181548110610d6f57600080fd5b9060005260206000209060040201600091509050806000018054610d9290611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610dbe90611adf565b8015610e0b5780601f10610de057610100808354040283529160200191610e0b565b820191906000526020600020905b815481529060010190602001808311610dee57829003601f168201915b505050505090806001018054610e2090611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c90611adf565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b505050505090806002018054610eae90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90611adf565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b505050505090806003018054610f3c90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6890611adf565b8015610fb55780601f10610f8a57610100808354040283529160200191610fb5565b820191906000526020600020905b815481529060010190602001808311610f9857829003601f168201915b5050505050905084565b610fc76112d9565b60005b8151811015611225576000828281518110610fe757610fe761196d565b6020026020010151600001516040516020016110039190611ce6565b60408051601f1981840301815291815281516020928301206000818152600690935291205490915080156110795760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920766572696669656400000000000000006044820152606401610244565b600484848151811061108d5761108d61196d565b602090810291909101810151825460018101845560009384529190922082516004909202019081906110bf9082611d02565b50602082015160018201906110d49082611d02565b50604082015160028201906110e99082611d02565b50606082015160038201906110fe9082611d02565b50506004546000848152600660205260409020555083518490849081106111275761112761196d565b6020026020010151600001515160001415801561116357508383815181106111515761115161196d565b60200260200101516020015151600014155b801561118e575083838151811061117c5761117c61196d565b60200260200101516040015151600014155b80156111b957508383815181106111a7576111a761196d565b60200260200101516060015151600014155b6112105760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642070726f6f66206f662061646472657373206f776e65727368604482015261069760f41b6064820152608401610244565b5050808061121d90611c83565b915050610fca565b507f382315d4d56a6035e1899bffe77d9becefaf5f2650e4323b27854857a0454658816040516112559190611dc2565b60405180910390a150565b6112686112d9565b6001600160a01b0381166112cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610244565b6112d681611333565b50565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610244565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261139557600080fd5b50813567ffffffffffffffff8111156113ad57600080fd5b6020830191508360208285010111156113c557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611405576114056113cc565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611434576114346113cc565b604052919050565b600067ffffffffffffffff821115611456576114566113cc565b5060051b60200190565b600082601f83011261147157600080fd5b813560206114866114818361143c565b61140b565b82815260059290921b840181019181810190868411156114a557600080fd5b8286015b848110156114c057803583529183019183016114a9565b509695505050505050565b600080600080600080608087890312156114e457600080fd5b863567ffffffffffffffff808211156114fc57600080fd5b6115088a838b01611383565b9098509650602089013591508082111561152157600080fd5b61152d8a838b01611383565b9096509450604089013591508082111561154657600080fd5b5061155389828a01611460565b925050606087013590509295509295509295565b60006020828403121561157957600080fd5b5035919050565b60005b8381101561159b578181015183820152602001611583565b50506000910152565b600081518084526115bc816020860160208601611580565b601f01601f19169290920160200192915050565b60008151608084526115e560808501826115a4565b9050602083015184820360208601526115fe82826115a4565b9150506040830151848203604086015261161882826115a4565b9150506060830151848203606086015261163282826115a4565b95945050505050565b60208152600061164e60208301846115d0565b9392505050565b60208152600061164e60208301846115a4565b600082601f83011261167957600080fd5b813567ffffffffffffffff811115611693576116936113cc565b6116a6601f8201601f191660200161140b565b8181528460208386010111156116bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156116ee57600080fd5b84359350602085013567ffffffffffffffff8082111561170d57600080fd5b61171988838901611668565b9450604087013591508082111561172f57600080fd5b61173b88838901611460565b9350606087013591508082111561175157600080fd5b5061175e87828801611460565b91505092959194509250565b60808152600061177d60808301876115a4565b828103602084015261178f81876115a4565b905082810360408401526117a381866115a4565b90508281036060840152610d5481856115a4565b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b81356118046114818261143c565b81815260059190911b8301840190848101908883111561182357600080fd5b8585015b838110156119045780358581111561183e57600080fd5b86016080818c03601f190112156118555760008081fd5b61185d6113e2565b888201358781111561186f5760008081fd5b61187d8d8b83860101611668565b825250604080830135888111156118945760008081fd5b6118a28e8c83870101611668565b8b84015250606080840135898111156118bb5760008081fd5b6118c98f8d83880101611668565b838501525060808401359150888211156118e35760008081fd5b6118f18e8c84870101611668565b9083015250845250918601918601611827565b5098975050505050505050565b60006020828403121561192357600080fd5b81356001600160a01b038116811461164e57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176119675761196761193a565b92915050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526020808501945080840160005b838110156119dc578151875295820195908201906001016119c0565b509495945050505050565b6001600160a01b0385168152606060208201819052600090611a0c9083018587611983565b8281036040840152610d5481856119ac565b600060208284031215611a3057600080fd5b8151801515811461164e57600080fd5b808201808211156119675761196761193a565b60008085851115611a6357600080fd5b83861115611a7057600080fd5b5050820193919092039150565b8385823760008482016000815283858237600093019283525090949350505050565b6001600160a01b0384168152606060208201819052600090611ac3908301856115a4565b8281036040840152611ad581856119ac565b9695505050505050565b600181811c90821680611af357607f821691505b602082108103611b1357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b6357600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b5050505b505050565b67ffffffffffffffff831115611b8057611b806113cc565b611b9483611b8e8354611adf565b83611b19565b6000601f841160018114611bc85760008515611bb05750838201355b600019600387901b1c1916600186901b178355611c22565b600083815260209020601f19861690835b82811015611bf95786850135825560209485019460019092019101611bd9565b5086821015611c165760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b606081526000611c3c60608301886119ac565b8281036020840152611c4f818789611983565b90508281036040840152611c64818587611983565b98975050505050505050565b818103818111156119675761196761193a565b600060018201611c9557611c9561193a565b5060010190565b6001600160a01b0385168152608060208201819052600090611cc0908301866115a4565b8281036040840152611cd281866119ac565b90508281036060840152610d5481856119ac565b60008251611cf8818460208701611580565b9190910192915050565b815167ffffffffffffffff811115611d1c57611d1c6113cc565b611d3081611d2a8454611adf565b84611b19565b602080601f831160018114611d655760008415611d4d5750858301515b600019600386901b1c1916600185901b178555611b5f565b600085815260208120601f198616915b82811015611d9457888601518255948401946001909101908401611d75565b5085821015611db25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611e1757603f19888603018452611e058583516115d0565b94509285019290850190600101611de9565b509297965050505050505056fea264697066735822122003289efcabd72228042cdf9ed14e56b3f9bb59f216f4c167aba43f646da8db4964736f6c63430008120033","deployedBytecode":"0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80637950c5f8116100715780637950c5f8146101335780638da5cb5b146101725780639c38255914610183578063a3c4bcf8146101a6578063c7ddca0e146101c9578063f2fde38b146101dc57600080fd5b806305ab9860146100ae57806319b33968146100c357806349ce8997146100ec578063715018a61461010c57806379502c5514610114575b600080fd5b6100c16100bc3660046114cb565b6101ef565b005b6100d66100d1366004611567565b610660565b6040516100e3919061163b565b60405180910390f35b6100ff6100fa366004611567565b610973565b6040516100e39190611655565b6100c1610a0d565b6003546101219060ff1681565b60405160ff90911681526020016100e3565b61015a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100e3565b6000546001600160a01b031661015a565b6101966101913660046116d8565b610a21565b60405190151581526020016100e3565b6101b96101b4366004611567565b610d5f565b6040516100e3949392919061176a565b6100c16101d73660046117b7565b610fbf565b6100c16101ea366004611911565b611260565b6101f76112d9565b600082511161024d5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420746f74616c2062616c616e636573206c656e67746800000060448201526064015b60405180910390fd5b815161025a906040611950565b83146102a85760405162461bcd60e51b815260206004820152601e60248201527f496e76616c6964206772616e642073756d2070726f6f66206c656e67746800006044820152606401610244565b8285116102f75760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736e61726b2070726f6f66206c656e6774680000000000006044820152606401610244565b6040805160018082528183019092526000916020808301908036833701905050905060018160008151811061032e5761032e61196d565b602090810291909101015260405163af83a18d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d906103ab907f0000000000000000000000000000000000000000000000000000000000000000908b908b9087906004016119e7565b602060405180830381865afa1580156103c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ec9190611a1e565b61042e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21039b730b93590383937b7b360691b6044820152606401610244565b6001548351146104a65760405162461bcd60e51b815260206004820152603a60248201527f4c696162696c69747920636f6d6d69746d656e747320616e642063727970746f60448201527f63757272656e63696573206e756d626572206d69736d617463680000000000006064820152608401610244565b3660008881896104b7896040611a40565b926104c493929190611a53565b9092509050600087876104da8460408188611a53565b6040516020016104ed9493929190611a7d565b60408051601f198184030181529082905263af83a18d60e01b825291506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063af83a18d9061056d907f00000000000000000000000000000000000000000000000000000000000000009085908b90600401611a9f565b602060405180830381865afa15801561058a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ae9190611a1e565b6105fa5760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206772616e642073756d2070726f6f660000000000000000006044820152606401610244565b6000858152600560205260409020610613838583611b68565b50847f7603a12a8838a565715ddb5bbf625b3f00a5e6f4793437537963e30c3b9495dc8785858c8c60405161064c959493929190611c29565b60405180910390a250505050505050505050565b61068b6040518060800160405280606081526020016060815260200160608152602001606081525090565b6000828152600660205260409020546106dd5760405162461bcd60e51b81526020600482015260146024820152731059191c995cdcc81b9bdd081d995c9a599a595960621b6044820152606401610244565b6000828152600660205260409020546004906106fb90600190611c70565b8154811061070b5761070b61196d565b906000526020600020906004020160405180608001604052908160008201805461073490611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461076090611adf565b80156107ad5780601f10610782576101008083540402835291602001916107ad565b820191906000526020600020905b81548152906001019060200180831161079057829003601f168201915b505050505081526020016001820180546107c690611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546107f290611adf565b801561083f5780601f106108145761010080835404028352916020019161083f565b820191906000526020600020905b81548152906001019060200180831161082257829003601f168201915b5050505050815260200160028201805461085890611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461088490611adf565b80156108d15780601f106108a6576101008083540402835291602001916108d1565b820191906000526020600020905b8154815290600101906020018083116108b457829003601f168201915b505050505081526020016003820180546108ea90611adf565b80601f016020809104026020016040519081016040528092919081815260200182805461091690611adf565b80156109635780601f1061093857610100808354040283529160200191610963565b820191906000526020600020905b81548152906001019060200180831161094657829003601f168201915b5050505050815250509050919050565b6005602052600090815260409020805461098c90611adf565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890611adf565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b505050505081565b610a156112d9565b610a1f6000611333565b565b60008251600414610a745760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206368616c6c656e676573206c656e677468000000000000006044820152606401610244565b6001805483519091610a8591611c70565b14610add5760405162461bcd60e51b815260206004820152602260248201527f56616c756573206c656e677468206d69736d61746368207769746820636f6e66604482015261696760f01b6064820152608401610244565b60008581526005602052604081208054610af690611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2290611adf565b8015610b6f5780601f10610b4457610100808354040283529160200191610b6f565b820191906000526020600020905b815481529060010190602001808311610b5257829003601f168201915b50505050509050600085518251610b869190611a40565b67ffffffffffffffff811115610b9e57610b9e6113cc565b6040519080825280601f01601f191660200182016040528015610bc8576020820181803683370190505b50905060005b8651811015610c2f57868181518110610be957610be961196d565b602001015160f81c60f81b828281518110610c0657610c0661196d565b60200101906001600160f81b031916908160001a90535080610c2781611c83565b915050610bce565b5060005b8251811015610ca057828181518110610c4e57610c4e61196d565b602001015160f81c60f81b82885183610c679190611a40565b81518110610c7757610c7761196d565b60200101906001600160f81b031916908160001a90535080610c9881611c83565b915050610c33565b506040516323fb5ad560e11b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906347f6b5aa90610d13907f00000000000000000000000000000000000000000000000000000000000000009085908a908a90600401611c9c565b602060405180830381865afa158015610d30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d549190611a1e565b979650505050505050565b60048181548110610d6f57600080fd5b9060005260206000209060040201600091509050806000018054610d9290611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610dbe90611adf565b8015610e0b5780601f10610de057610100808354040283529160200191610e0b565b820191906000526020600020905b815481529060010190602001808311610dee57829003601f168201915b505050505090806001018054610e2090611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4c90611adf565b8015610e995780601f10610e6e57610100808354040283529160200191610e99565b820191906000526020600020905b815481529060010190602001808311610e7c57829003601f168201915b505050505090806002018054610eae90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610eda90611adf565b8015610f275780601f10610efc57610100808354040283529160200191610f27565b820191906000526020600020905b815481529060010190602001808311610f0a57829003601f168201915b505050505090806003018054610f3c90611adf565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6890611adf565b8015610fb55780601f10610f8a57610100808354040283529160200191610fb5565b820191906000526020600020905b815481529060010190602001808311610f9857829003601f168201915b5050505050905084565b610fc76112d9565b60005b8151811015611225576000828281518110610fe757610fe761196d565b6020026020010151600001516040516020016110039190611ce6565b60408051601f1981840301815291815281516020928301206000818152600690935291205490915080156110795760405162461bcd60e51b815260206004820152601860248201527f4164647265737320616c726561647920766572696669656400000000000000006044820152606401610244565b600484848151811061108d5761108d61196d565b602090810291909101810151825460018101845560009384529190922082516004909202019081906110bf9082611d02565b50602082015160018201906110d49082611d02565b50604082015160028201906110e99082611d02565b50606082015160038201906110fe9082611d02565b50506004546000848152600660205260409020555083518490849081106111275761112761196d565b6020026020010151600001515160001415801561116357508383815181106111515761115161196d565b60200260200101516020015151600014155b801561118e575083838151811061117c5761117c61196d565b60200260200101516040015151600014155b80156111b957508383815181106111a7576111a761196d565b60200260200101516060015151600014155b6112105760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642070726f6f66206f662061646472657373206f776e65727368604482015261069760f41b6064820152608401610244565b5050808061121d90611c83565b915050610fca565b507f382315d4d56a6035e1899bffe77d9becefaf5f2650e4323b27854857a0454658816040516112559190611dc2565b60405180910390a150565b6112686112d9565b6001600160a01b0381166112cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610244565b6112d681611333565b50565b6000546001600160a01b03163314610a1f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610244565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008083601f84011261139557600080fd5b50813567ffffffffffffffff8111156113ad57600080fd5b6020830191508360208285010111156113c557600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611405576114056113cc565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611434576114346113cc565b604052919050565b600067ffffffffffffffff821115611456576114566113cc565b5060051b60200190565b600082601f83011261147157600080fd5b813560206114866114818361143c565b61140b565b82815260059290921b840181019181810190868411156114a557600080fd5b8286015b848110156114c057803583529183019183016114a9565b509695505050505050565b600080600080600080608087890312156114e457600080fd5b863567ffffffffffffffff808211156114fc57600080fd5b6115088a838b01611383565b9098509650602089013591508082111561152157600080fd5b61152d8a838b01611383565b9096509450604089013591508082111561154657600080fd5b5061155389828a01611460565b925050606087013590509295509295509295565b60006020828403121561157957600080fd5b5035919050565b60005b8381101561159b578181015183820152602001611583565b50506000910152565b600081518084526115bc816020860160208601611580565b601f01601f19169290920160200192915050565b60008151608084526115e560808501826115a4565b9050602083015184820360208601526115fe82826115a4565b9150506040830151848203604086015261161882826115a4565b9150506060830151848203606086015261163282826115a4565b95945050505050565b60208152600061164e60208301846115d0565b9392505050565b60208152600061164e60208301846115a4565b600082601f83011261167957600080fd5b813567ffffffffffffffff811115611693576116936113cc565b6116a6601f8201601f191660200161140b565b8181528460208386010111156116bb57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156116ee57600080fd5b84359350602085013567ffffffffffffffff8082111561170d57600080fd5b61171988838901611668565b9450604087013591508082111561172f57600080fd5b61173b88838901611460565b9350606087013591508082111561175157600080fd5b5061175e87828801611460565b91505092959194509250565b60808152600061177d60808301876115a4565b828103602084015261178f81876115a4565b905082810360408401526117a381866115a4565b90508281036060840152610d5481856115a4565b600060208083850312156117ca57600080fd5b823567ffffffffffffffff808211156117e257600080fd5b818501915085601f8301126117f657600080fd5b81356118046114818261143c565b81815260059190911b8301840190848101908883111561182357600080fd5b8585015b838110156119045780358581111561183e57600080fd5b86016080818c03601f190112156118555760008081fd5b61185d6113e2565b888201358781111561186f5760008081fd5b61187d8d8b83860101611668565b825250604080830135888111156118945760008081fd5b6118a28e8c83870101611668565b8b84015250606080840135898111156118bb5760008081fd5b6118c98f8d83880101611668565b838501525060808401359150888211156118e35760008081fd5b6118f18e8c84870101611668565b9083015250845250918601918601611827565b5098975050505050505050565b60006020828403121561192357600080fd5b81356001600160a01b038116811461164e57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176119675761196761193a565b92915050565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600081518084526020808501945080840160005b838110156119dc578151875295820195908201906001016119c0565b509495945050505050565b6001600160a01b0385168152606060208201819052600090611a0c9083018587611983565b8281036040840152610d5481856119ac565b600060208284031215611a3057600080fd5b8151801515811461164e57600080fd5b808201808211156119675761196761193a565b60008085851115611a6357600080fd5b83861115611a7057600080fd5b5050820193919092039150565b8385823760008482016000815283858237600093019283525090949350505050565b6001600160a01b0384168152606060208201819052600090611ac3908301856115a4565b8281036040840152611ad581856119ac565b9695505050505050565b600181811c90821680611af357607f821691505b602082108103611b1357634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611b6357600081815260208120601f850160051c81016020861015611b405750805b601f850160051c820191505b81811015611b5f57828155600101611b4c565b5050505b505050565b67ffffffffffffffff831115611b8057611b806113cc565b611b9483611b8e8354611adf565b83611b19565b6000601f841160018114611bc85760008515611bb05750838201355b600019600387901b1c1916600186901b178355611c22565b600083815260209020601f19861690835b82811015611bf95786850135825560209485019460019092019101611bd9565b5086821015611c165760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b606081526000611c3c60608301886119ac565b8281036020840152611c4f818789611983565b90508281036040840152611c64818587611983565b98975050505050505050565b818103818111156119675761196761193a565b600060018201611c9557611c9561193a565b5060010190565b6001600160a01b0385168152608060208201819052600090611cc0908301866115a4565b8281036040840152611cd281866119ac565b90508281036060840152610d5481856119ac565b60008251611cf8818460208701611580565b9190910192915050565b815167ffffffffffffffff811115611d1c57611d1c6113cc565b611d3081611d2a8454611adf565b84611b19565b602080601f831160018114611d655760008415611d4d5750858301515b600019600386901b1c1916600185901b178555611b5f565b600085815260208120601f198616915b82811015611d9457888601518255948401946001909101908401611d75565b5085821015611db25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611e1757603f19888603018452611e058583516115d0565b94509285019290850190600101611de9565b509297965050505050505056fea264697066735822122003289efcabd72228042cdf9ed14e56b3f9bb59f216f4c167aba43f646da8db4964736f6c63430008120033","linkReferences":{},"deployedLinkReferences":{}} \ No newline at end of file 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/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.