smt-rollup
Version:
Sparse Merkle Tree roll up
833 lines (832 loc) • 142 kB
JSON
{
"contractName": "SMTExample",
"abi": [
{
"inputs": [
{
"internalType": "bytes32",
"name": "root",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "leaf",
"type": "bytes32"
},
{
"internalType": "bytes32[256]",
"name": "siblings",
"type": "bytes32[256]"
}
],
"name": "inclusionProof",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "root",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "leaf",
"type": "bytes32"
},
{
"internalType": "bytes32[256]",
"name": "siblings",
"type": "bytes32[256]"
}
],
"name": "nonInclusionProof",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "root",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "leaf",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "value",
"type": "bytes32"
},
{
"internalType": "bytes32[256]",
"name": "siblings",
"type": "bytes32[256]"
}
],
"name": "merkleProof",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "root",
"type": "bytes32"
},
{
"internalType": "bytes32[]",
"name": "leaves",
"type": "bytes32[]"
},
{
"internalType": "bytes32[256][]",
"name": "siblings",
"type": "bytes32[256][]"
}
],
"name": "rollUp",
"outputs": [
{
"internalType": "bytes32",
"name": "nextRoot",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "root",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "nextRoot",
"type": "bytes32"
},
{
"internalType": "bytes32[]",
"name": "leaves",
"type": "bytes32[]"
},
{
"internalType": "bytes32[256][]",
"name": "siblings",
"type": "bytes32[256][]"
}
],
"name": "rollUpProof",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.0+commit.26b70077\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"leaf\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[256]\",\"name\":\"siblings\",\"type\":\"bytes32[256]\"}],\"name\":\"inclusionProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"leaf\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"value\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[256]\",\"name\":\"siblings\",\"type\":\"bytes32[256]\"}],\"name\":\"merkleProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"leaf\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[256]\",\"name\":\"siblings\",\"type\":\"bytes32[256]\"}],\"name\":\"nonInclusionProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"leaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[256][]\",\"name\":\"siblings\",\"type\":\"bytes32[256][]\"}],\"name\":\"rollUp\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"nextRoot\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"nextRoot\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32[]\",\"name\":\"leaves\",\"type\":\"bytes32[]\"},{\"internalType\":\"bytes32[256][]\",\"name\":\"siblings\",\"type\":\"bytes32[256][]\"}],\"name\":\"rollUpProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/examples/SMTExample.sol\":\"SMTExample\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/SMT.sol\":{\"keccak256\":\"0x6da0de244d820286121a3dc7149968c8c6e449ac529e28c2c720247b5e4635c5\",\"urls\":[\"bzz-raw://4e3adc3a46b1974a95a58dc7a7b7ef09eb33a4b07e23091c73dd98fef92b8e63\",\"dweb:/ipfs/QmZ21CJPA6utrtUMoL4esHmFa2hAEQFE5eFjqjN4e9ikBh\"]},\"/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/examples/SMTExample.sol\":{\"keccak256\":\"0xc913d9c1b7496995984c5dacf90e233e2ebfdf887cf8e7b699a64dfa38840d03\",\"urls\":[\"bzz-raw://4eb7bbd69d5ad5e1227d4fcc34429686e0b667b2635725baae11d9b862a25fc8\",\"dweb:/ipfs/QmTMVQ9kJUvD8RtaaiWqEsqGAKSbTKok1Niu96o3hVw5pp\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610b6e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806320f8f1fe1461005c57806350145f24146100f1578063ae80c692146102a9578063ced5249214610348578063e9f0a714146103dd575b600080fd5b6100d7600480360361204081101561007357600080fd5b81019080803590602001909291908035906020019092919080612000019061010080602002604051908101604052809291908261010060200280828437600081840152601f19601f8201169050808301925050505050509192919290505050610587565b604051808215151515815260200191505060405180910390f35b61028f6004803603608081101561010757600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561013857600080fd5b82018360208201111561014a57600080fd5b8035906020019184602083028401116401000000008311171561016c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101cc57600080fd5b8201836020820111156101de57600080fd5b803590602001918461200083028401116401000000008311171561020157600080fd5b9190808060200260200160405190810160405280939291908181526020016000905b8282101561027d578484839050612000020161010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505081526020019060010190610223565b505050505091929192905050506105a7565b604051808215151515815260200191505060405180910390f35b61032e60048036036120608110156102c057600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080612000019061010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505091929192905050506105ca565b604051808215151515815260200191505060405180910390f35b6103c3600480360361204081101561035f57600080fd5b81019080803590602001909291908035906020019092919080612000019061010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505091929192905050506105ed565b604051808215151515815260200191505060405180910390f35b610571600480360360608110156103f357600080fd5b81019080803590602001909291908035906020019064010000000081111561041a57600080fd5b82018360208201111561042c57600080fd5b8035906020019184602083028401116401000000008311171561044e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156104ae57600080fd5b8201836020820111156104c057600080fd5b80359060200191846120008302840111640100000000831117156104e357600080fd5b9190808060200260200160405190810160405280939291908181526020016000905b8282101561055f578484839050612000020161010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505081526020019060010190610505565b5050505050919291929050505061060d565b6040518082815260200191505060405180910390f35b600061059e83838661062d9092919063ffffffff16565b90509392505050565b60006105c084848488610667909392919063ffffffff16565b9050949350505050565b60006105e3848484886106eb909392919063ffffffff16565b9050949350505050565b60006106048383866107789092919063ffffffff16565b90509392505050565b60006106248383866107b29092919063ffffffff16565b90509392505050565b600061065e84847fb0b4e07bb5592f3d3821b2c1331b436763d7be555cf452d6c6836f74d5201e8560001b856106eb565b90509392505050565b600061068c6040518060600160405280878152602001858152602001848152506107e0565b84146106e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180610aeb602c913960400191505060405180910390fd5b949350505050565b6000846106f98585856108b2565b1461076c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c6964206d65726b6c652070726f6f6600000000000000000000000081525060200191505060405180910390fd5b60019050949350505050565b60006107a984847f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56360001b856106eb565b90509392505050565b60006107d76040518060600160405280868152602001858152602001848152506107e0565b90509392505050565b600081604001515182602001515114610844576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610b176022913960400191505060405180910390fd5b60008260000151905060008090505b8360200151518110156108a857610899828560200151838151811061087457fe5b60200260200101518660400151848151811061088c57fe5b602002602001015161099a565b91508080600101915050610853565b5080915050919050565b60008083905060008560001c905060008090505b6101008161ffff16101561098d576000600283816108e057fe5b0614156109325782858261ffff1661010081106108f957fe5b60200201516040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610979565b848161ffff16610100811061094357fe5b60200201518360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b600182901c915080806001019150506108c6565b5081925050509392505050565b60006109a7848484610778565b6109fc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526041815260200180610aaa6041913960600191505060405180910390fd5b610a2a837fb0b4e07bb5592f3d3821b2c1331b436763d7be555cf452d6c6836f74d5201e8560001b846108b2565b905080841415610aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f416c726561647920657869736974696e67206c6561660000000000000000000081525060200191505060405180910390fd5b939250505056fe4661696c656420746f206275696c64207468652070726576696f757320726f6f74207573696e67206a746865206c65616620616e6420697473207369626c696e674661696c656420746f20647269766520746865206e65787420726f6f742066726f6d207468652070726f6f66426f74682061727261792073686f756c6420686176652073616d65206c656e677468a2646970667358221220496ef3bd68a143365ef884ac75c61b534dfef127d39112de20c8bdbf71727f9464736f6c63430006000033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c806320f8f1fe1461005c57806350145f24146100f1578063ae80c692146102a9578063ced5249214610348578063e9f0a714146103dd575b600080fd5b6100d7600480360361204081101561007357600080fd5b81019080803590602001909291908035906020019092919080612000019061010080602002604051908101604052809291908261010060200280828437600081840152601f19601f8201169050808301925050505050509192919290505050610587565b604051808215151515815260200191505060405180910390f35b61028f6004803603608081101561010757600080fd5b8101908080359060200190929190803590602001909291908035906020019064010000000081111561013857600080fd5b82018360208201111561014a57600080fd5b8035906020019184602083028401116401000000008311171561016c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101cc57600080fd5b8201836020820111156101de57600080fd5b803590602001918461200083028401116401000000008311171561020157600080fd5b9190808060200260200160405190810160405280939291908181526020016000905b8282101561027d578484839050612000020161010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505081526020019060010190610223565b505050505091929192905050506105a7565b604051808215151515815260200191505060405180910390f35b61032e60048036036120608110156102c057600080fd5b8101908080359060200190929190803590602001909291908035906020019092919080612000019061010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505091929192905050506105ca565b604051808215151515815260200191505060405180910390f35b6103c3600480360361204081101561035f57600080fd5b81019080803590602001909291908035906020019092919080612000019061010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505091929192905050506105ed565b604051808215151515815260200191505060405180910390f35b610571600480360360608110156103f357600080fd5b81019080803590602001909291908035906020019064010000000081111561041a57600080fd5b82018360208201111561042c57600080fd5b8035906020019184602083028401116401000000008311171561044e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156104ae57600080fd5b8201836020820111156104c057600080fd5b80359060200191846120008302840111640100000000831117156104e357600080fd5b9190808060200260200160405190810160405280939291908181526020016000905b8282101561055f578484839050612000020161010080602002604051908101604052809291908261010060200280828437600081840152601f19601f82011690508083019250505050505081526020019060010190610505565b5050505050919291929050505061060d565b6040518082815260200191505060405180910390f35b600061059e83838661062d9092919063ffffffff16565b90509392505050565b60006105c084848488610667909392919063ffffffff16565b9050949350505050565b60006105e3848484886106eb909392919063ffffffff16565b9050949350505050565b60006106048383866107789092919063ffffffff16565b90509392505050565b60006106248383866107b29092919063ffffffff16565b90509392505050565b600061065e84847fb0b4e07bb5592f3d3821b2c1331b436763d7be555cf452d6c6836f74d5201e8560001b856106eb565b90509392505050565b600061068c6040518060600160405280878152602001858152602001848152506107e0565b84146106e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180610aeb602c913960400191505060405180910390fd5b949350505050565b6000846106f98585856108b2565b1461076c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e76616c6964206d65726b6c652070726f6f6600000000000000000000000081525060200191505060405180910390fd5b60019050949350505050565b60006107a984847f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56360001b856106eb565b90509392505050565b60006107d76040518060600160405280868152602001858152602001848152506107e0565b90509392505050565b600081604001515182602001515114610844576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610b176022913960400191505060405180910390fd5b60008260000151905060008090505b8360200151518110156108a857610899828560200151838151811061087457fe5b60200260200101518660400151848151811061088c57fe5b602002602001015161099a565b91508080600101915050610853565b5080915050919050565b60008083905060008560001c905060008090505b6101008161ffff16101561098d576000600283816108e057fe5b0614156109325782858261ffff1661010081106108f957fe5b60200201516040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610979565b848161ffff16610100811061094357fe5b60200201518360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b600182901c915080806001019150506108c6565b5081925050509392505050565b60006109a7848484610778565b6109fc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526041815260200180610aaa6041913960600191505060405180910390fd5b610a2a837fb0b4e07bb5592f3d3821b2c1331b436763d7be555cf452d6c6836f74d5201e8560001b846108b2565b905080841415610aa2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f416c726561647920657869736974696e67206c6561660000000000000000000081525060200191505060405180910390fd5b939250505056fe4661696c656420746f206275696c64207468652070726576696f757320726f6f74207573696e67206a746865206c65616620616e6420697473207369626c696e674661696c656420746f20647269766520746865206e65787420726f6f742066726f6d207468652070726f6f66426f74682061727261792073686f756c6420686176652073616d65206c656e677468a2646970667358221220496ef3bd68a143365ef884ac75c61b534dfef127d39112de20c8bdbf71727f9464736f6c63430006000033",
"sourceMap": "65:1150:3:-:0;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;65:1150:3;;;;;;;",
"deployedSourceMap": "65:1150:3:-:0;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;65:1150:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;116:197;;;;;;13:4:-1;8:3;5:13;2:2;;;31:1;28;21:12;2:2;116:197:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;116:197:3;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;970:243;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;970:243:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;970:243:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;970:243:3;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;970:243:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;970:243:3;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;970:243:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;970:243:3;;;;;;103:9:-1;95:4;81:12;77:23;67:8;63:38;60:53;39:11;25:12;22:29;11:110;8:2;;;134:1;131;124:12;8:2;970:243:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;970:243:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;528:221;;;;;;13:4:-1;8:3;5:13;2:2;;;31:1;28;21:12;2:2;528:221:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;528:221:3;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;319:203;;;;;;13:4:-1;8:3;5:13;2:2;;;31:1;28;21:12;2:2;319:203:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;319:203:3;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;755:209;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;755:209:3;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;755:209:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;755:209:3;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;755:209:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;755:209:3;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;755:209:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;755:209:3;;;;;;103:9:-1;95:4;81:12;77:23;67:8;63:38;60:53;39:11;25:12;22:29;11:110;8:2;;;134:1;131;124:12;8:2;755:209:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;755:209:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;116:197;248:4;271:35;291:4;297:8;271:4;:19;;:35;;;;;:::i;:::-;264:42;;116:197;;;;;:::o;970:243::-;1139:4;1162:44;1179:8;1189:6;1197:8;1162:4;:16;;:44;;;;;;:::i;:::-;1155:51;;970:243;;;;;;:::o;528:221::-;680:4;703:39;720:4;726:5;733:8;703:4;:16;;:39;;;;;;:::i;:::-;696:46;;528:221;;;;;;:::o;319:203::-;454:4;477:38;500:4;506:8;477:4;:22;;:38;;;;;:::i;:::-;470:45;;319:203;;;;;:::o;755:209::-;893:16;928:29;940:6;948:8;928:4;:11;;:29;;;;;:::i;:::-;921:36;;755:209;;;;;:::o;843:204:1:-;977:4;1000:40;1012:4;1018;361:66;1024:5;;1031:8;1000:11;:40::i;:::-;993:47;;843:204;;;;;:::o;3521:301::-;3692:4;3728:38;3735:30;;;;;;;;3742:4;3735:30;;;;3748:6;3735:30;;;;3756:8;3735:30;;;3728:6;:38::i;:::-;3716:8;:50;3708:107;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3521:301;;;;;;:::o;1270:275::-;1424:4;1488;1448:36;1462:4;1468:5;1475:8;1448:13;:36::i;:::-;:44;1440:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1534:4;1527:11;;1270:275;;;;;;:::o;1053:211::-;1190:4;1213:44;1225:4;1231;563:66;1237:9;;1248:8;1213:11;:44::i;:::-;1206:51;;1053:211;;;;;:::o;3291:224::-;3431:16;3470:38;3477:30;;;;;;;;3484:4;3477:30;;;;3490:6;3477:30;;;;3498:8;3477:30;;;3470:6;:38::i;:::-;3459:49;;3291:224;;;;;:::o;2795:490::-;2855:7;2945:5;:14;;;:21;2922:5;:12;;;:19;:44;2914:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3046:12;3061:5;:10;;;3046:25;;3135:6;3144:1;3135:10;;3130:128;3151:5;:12;;;:19;3147:1;:23;3130:128;;;3199:48;3206:4;3212:5;:12;;;3225:1;3212:15;;;;;;;;;;;;;;3229:5;:14;;;3244:1;3229:17;;;;;;;;;;;;;;3199:6;:48::i;:::-;3192:55;;3172:4;;;;;;;3130:128;;;;3274:4;3267:11;;;2795:490;;;:::o;1551:616::-;1686:7;1705:14;1722:5;1705:22;;1737:9;1754:4;1749:10;;1737:22;;1774:8;1785:1;1774:12;;1769:369;1792:15;1788:1;:19;;;1769:369;;;1844:1;1839;1832:4;:8;;;;;;:13;1828:270;;;1934:6;1942:8;1951:1;1942:11;;;;;;;;;;;;;1917:37;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1917:37:1;;;1907:48;;;;;;1898:57;;1828:270;;;2062:8;2071:1;2062:11;;;;;;;;;;;;;2075:6;2045:37;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2045:37:1;;;2035:48;;;;;;2026:57;;1828:270;2126:1;2118:4;:9;;2111:16;;1809:3;;;;;;;1769:369;;;;2154:6;2147:13;;;;1551:616;;;;;:::o;2173:::-;2300:16;2433:39;2451:4;2457;2463:8;2433:17;:39::i;:::-;2425:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2644:36;2658:4;361:66;2664:5;;2671:8;2644:13;:36::i;:::-;2633:47;;2747:8;2739:4;:16;;2731:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2173:616;;;;;:::o",
"source": "pragma solidity >= 0.6.0;\n\nimport { SMT256 } from \"../SMT.sol\";\n\ncontract SMTExample {\n using SMT256 for *;\n\n function inclusionProof(\n bytes32 root,\n bytes32 leaf,\n bytes32[256] memory siblings\n ) public pure returns(bool) {\n return root.inclusionProof(leaf, siblings);\n }\n\n function nonInclusionProof(\n bytes32 root,\n bytes32 leaf,\n bytes32[256] memory siblings\n ) public pure returns(bool) {\n return root.nonInclusionProof(leaf, siblings);\n }\n\n function merkleProof(\n bytes32 root,\n bytes32 leaf,\n bytes32 value,\n bytes32[256] memory siblings\n ) public pure returns(bool) {\n return root.merkleProof(leaf, value, siblings);\n }\n\n function rollUp(\n bytes32 root,\n bytes32[] memory leaves,\n bytes32[256][] memory siblings\n ) public pure returns (bytes32 nextRoot) {\n return root.rollUp(leaves, siblings);\n }\n\n function rollUpProof(\n bytes32 root,\n bytes32 nextRoot,\n bytes32[] memory leaves,\n bytes32[256][] memory siblings\n ) public pure returns (bool) {\n return root.rollUpProof(nextRoot, leaves, siblings);\n }\n}",
"sourcePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/examples/SMTExample.sol",
"ast": {
"absolutePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/examples/SMTExample.sol",
"exportedSymbols": {
"SMTExample": [
732
]
},
"id": 733,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 617,
"literals": [
"solidity",
">=",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:25:3"
},
{
"absolutePath": "/home/wanseob/Projects/wilsonbeam/smt-rollup/contracts/SMT.sol",
"file": "../SMT.sol",
"id": 619,
"nodeType": "ImportDirective",
"scope": 733,
"sourceUnit": 523,
"src": "27:36:3",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 618,
"name": "SMT256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "36:6:3",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 732,
"linearizedBaseContracts": [
732
],
"name": "SMTExample",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 621,
"libraryName": {
"contractScope": null,
"id": 620,
"name": "SMT256",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 522,
"src": "97:6:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SMT256_$522",
"typeString": "library SMT256"
}
},
"nodeType": "UsingForDirective",
"src": "91:19:3",
"typeName": null
},
{
"body": {
"id": 640,
"nodeType": "Block",
"src": "254:59:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 636,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 625,
"src": "291:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 637,
"name": "siblings",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 629,
"src": "297:8:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256] memory"
}
],
"expression": {
"argumentTypes": null,
"id": 634,
"name": "root",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 623,
"src": "271:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 635,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "inclusionProof",
"nodeType": "MemberAccess",
"referencedDeclaration": 105,
"src": "271:19:3",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes32_$_t_array$_t_bytes32_$256_memory_ptr_$returns$_t_bool_$bound_to$_t_bytes32_$",
"typeString": "function (bytes32,bytes32,bytes32[256] memory) pure returns (bool)"
}
},
"id": 638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "271:35:3",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 633,
"id": 639,
"nodeType": "Return",
"src": "264:42:3"
}
]
},
"documentation": null,
"functionSelector": "20f8f1fe",
"id": 641,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "inclusionProof",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 630,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 623,
"name": "root",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 641,
"src": "149:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 622,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "149:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 625,
"name": "leaf",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 641,
"src": "171:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 624,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "171:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 629,
"name": "siblings",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 641,
"src": "193:28:3",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256]"
},
"typeName": {
"baseType": {
"id": 626,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "193:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 628,
"length": {
"argumentTypes": null,
"hexValue": "323536",
"id": 627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "201:3:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
},
"value": "256"
},
"nodeType": "ArrayTypeName",
"src": "193:12:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_storage_ptr",
"typeString": "bytes32[256]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "139:88:3"
},
"returnParameters": {
"id": 633,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 632,
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 641,
"src": "248:4:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 631,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "248:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "247:6:3"
},
"scope": 732,
"src": "116:197:3",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 660,
"nodeType": "Block",
"src": "460:62:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 656,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 645,
"src": "500:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 657,
"name": "siblings",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 649,
"src": "506:8:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256] memory"
}
],
"expression": {
"argumentTypes": null,
"id": 654,
"name": "root",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 643,
"src": "477:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 655,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "nonInclusionProof",
"nodeType": "MemberAccess",
"referencedDeclaration": 126,
"src": "477:22:3",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes32_$_t_array$_t_bytes32_$256_memory_ptr_$returns$_t_bool_$bound_to$_t_bytes32_$",
"typeString": "function (bytes32,bytes32,bytes32[256] memory) pure returns (bool)"
}
},
"id": 658,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "477:38:3",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 653,
"id": 659,
"nodeType": "Return",
"src": "470:45:3"
}
]
},
"documentation": null,
"functionSelector": "ced52492",
"id": 661,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "nonInclusionProof",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 650,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 643,
"name": "root",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 661,
"src": "355:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 642,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "355:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 645,
"name": "leaf",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 661,
"src": "377:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 644,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "377:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 649,
"name": "siblings",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 661,
"src": "399:28:3",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256]"
},
"typeName": {
"baseType": {
"id": 646,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "399:7:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 648,
"length": {
"argumentTypes": null,
"hexValue": "323536",
"id": 647,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "407:3:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
},
"value": "256"
},
"nodeType": "ArrayTypeName",
"src": "399:12:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_storage_ptr",
"typeString": "bytes32[256]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "345:88:3"
},
"returnParameters": {
"id": 653,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 652,
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 661,
"src": "454:4:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 651,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "454:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "453:6:3"
},
"scope": 732,
"src": "319:203:3",
"stateMutability": "pure",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 683,
"nodeType": "Block",
"src": "686:63:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 678,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 665,
"src": "720:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 679,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 667,
"src": "726:5:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 680,
"name": "siblings",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 671,
"src": "733:8:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256] memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_array$_t_bytes32_$256_memory_ptr",
"typeString": "bytes32[256] memory"