test: added Deposit unit tests

This commit is contained in:
PedroCailleret committed 2022-12-04 22:13:54 -03:00
1 parent eb4cca9c12
commit 606406f889
23 files changed
+367 -31

No files matched your search

@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/e5d5971d8e129f0e49fa041ef3572fed.json"
}
@@ -157,6 +157,24 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "to",
"type": "address[]"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
@@ -312,8 +330,8 @@
"type": "function"
}
],
"bytecode": "0x60e06040523480156200001157600080fd5b5060405162000e5138038062000e51833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610a86620003cb600039600061044501526000610410015260006101490152610a866000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107de565b60405180910390f35b61010a61010536600461084f565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610879565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108b5565b60036020526000908152604090205481565b6101236101b33660046108b5565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461084f565b610474565b6101f36101ee3660046108d7565b6104ec565b005b61012361020336600461094a565b600460209081526000928352604080842090915290825290205481565b6000805461022d9061097d565b80601f01602080910402602001604051908101604052809291908181526020018280546102599061097d565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109b8565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109b8565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104425761043d610744565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461022d9061097d565b336000908152600360205260408120805483919083906104959084906109b8565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b61010083015261010282019290925261Line truncated
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107de565b60405180910390f35b61010a61010536600461084f565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610879565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108b5565b60036020526000908152604090205481565b6101236101b33660046108b5565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461084f565b610474565b6101f36101ee3660046108d7565b6104ec565b005b61012361020336600461094a565b600460209081526000928352604080842090915290825290205481565b6000805461022d9061097d565b80601f01602080910402602001604051908101604052809291908181526020018280546102599061097d565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109b8565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109b8565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104425761043d610744565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461022d9061097d565b336000908152600360205260408120805483919083906104959084906109b8565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610659573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580159061068f5750876001600160a01b0316816001600160a01b0316145b6106db5760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610538565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600060405161077691906109dd565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600060208083528351808285015260005b8181101561080b578581018301518582016040015282016107ef565b8181111561081d576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461084a57600080fd5b919050565b6000806040838503121561086257600080fd5b61086b83610833565b946020939093013593505050565b60008060006060848603121561088e57600080fd5b61089784610833565b92506108a560208501610833565b9150604084013590509250925092565b6000602082840312156108c757600080fd5b6108d082610833565b9392505050565b600080600080600080600060e0888a0312156108f257600080fd5b6108fb88610833565b965061090960208901610833565b95506040880135945060608801359350608088013560ff8116811461092d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561095d57600080fd5b61096683610833565b915061097460208401610833565b90509250929050565b600181811c9082168061099157607f821691505b602082108114156109b257634e487b7160e01b600052602260045260246000fd5b50919050Line truncated
"bytecode": "0x60e06040523480156200001157600080fd5b506040516200105238038062001052833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610c87620003cb60003960006104630152600061042e015260006101540152610c876000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906108ad565b60405180910390f35b61011561011036600461091e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610948565b610338565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e61042a565b61012e61019e366004610984565b60036020526000908152604090205481565b61012e6101be366004610984565b60056020526000908152604090205481565b6100ec610485565b6101156101e636600461091e565b610492565b6101fe6101f93660046109a6565b61050a565b005b61012e61020e366004610a19565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610a62565b610762565b6000805461024b90610b2d565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610b2d565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103279086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103945761036f8382610b7e565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103bc908490610b7e565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104179087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104605761045b6107a8565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610b2d565b336000908152600360205260408120805483919083906104b3908490610b7e565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103279086815260200190565b4284101561055f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161056b61042a565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152Line truncated
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906108ad565b60405180910390f35b61011561011036600461091e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610948565b610338565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e61042a565b61012e61019e366004610984565b60036020526000908152604090205481565b61012e6101be366004610984565b60056020526000908152604090205481565b6100ec610485565b6101156101e636600461091e565b610492565b6101fe6101f93660046109a6565b61050a565b005b61012e61020e366004610a19565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610a62565b610762565b6000805461024b90610b2d565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610b2d565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103279086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103945761036f8382610b7e565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103bc908490610b7e565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104179087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104605761045b6107a8565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610b2d565b336000908152600360205260408120805483919083906104b3908490610b7e565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103279086815260200190565b4284101561055f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161056b61042a565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610677573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906106ad5750876001600160a01b0316816001600160a01b0316145b6106f95760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610556565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b815160005b818110156107a25761079284828151811061078457610784610b95565b602002602001015184610842565b61079b81610bab565b9050610767565b50505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60006040516107da9190610bc6565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546108549190610c62565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060208083528351808285015260005b818110156108da578581018301518582016040015282016108be565b818111156108ec576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461091957600080fd5b919050565b6000806040838503121561093157600080fd5b61093a83610902565b946020939093013593505050565b60008060006060848603121561095d57600080fd5b61096684610902565b925061097460208501610902565b9150604084013590509250925092565b60006020828403121561099657600080fd5b61099f82610902565b9392505050565b600080600080600080600060e0888a03Line truncated
"linkReferences": {},
"deployedLinkReferences": {}
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../../../build-info/ce60783a904758b510bc61bc47947601.json"
}
+1 -1
View File
@@ -1,4 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../build-info/59c1a703d41bd7d2c615a37cdb738573.json"
"buildInfo": "../../build-info/ce60783a904758b510bc61bc47947601.json"
}
+2 -2
View File
@@ -854,8 +854,8 @@
"type": "receive"
}
],
"bytecode": "0x60806040526001805560405162002814380380620028148339810160408190526200002a916200049d565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000620565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806004557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005bb565b60200260200101516200038760201b60201c565b6000908152600660205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005d1565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083016020830282015b8083146200037f578251600052600b60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003d857620003d862000397565b604052919050565b60006001600160401b03821115620003fc57620003fc62000397565b5060051b60200190565b6001600160a01b03811681146200041c57600080fd5b50565b600082601f8301126200043157600080fd5b815160206200044a6200044483620003e0565b620003ad565b82815260059290921b840181019181810190868411156200046a57600080fd5b8286015b8481101562000492578051620004848162000406565b83529183019183016200046e565b509695505050505050565b600080600080600060a08688031215620004b657600080fd5b8551602080880151919650906001600160401b0380821115620004d857600080fd5b620004e68a838b016200041f565b965060408901519150620004fa8262000406565b6060890151919550808211156200051057600080fd5b6200051e8a838b016200041f565b945060808901519150808211156200053557600080fd5b508701601f810189136200054857600080fd5b8051620005596200044482620003e0565b81815260059190911b8201830190838101908b8311156200057957600080fd5b928401925b82841015620005a95783518015158114620005995760008081fd5b825292840192908401906200057e565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015620006145783516001600160a01b031683529284019291840191600101620005ed565b50909695505050505050565b6121e480620006306000396000f3fe60806040526004361061018f5760003560e01c806377cd38a4116100d65780638e2a3d361161007f578063c52164c611610059578063c52164c614610539578063d6e8b97314610559578063f7d0e04b1461057957600080fd5b80638e2a3d36146104c25780639872dbfe146104f357806398a268711461050957600080fd5b80638652b37e116100b05780638652b37e1461044a5780638da5cb5b1461046a5780638e2749d6146104a257600080fd5b806377cd38a4146103dd5780637f94f65d1461040a5780638642b5c31461042a57600080fd5b806336317972116101385780635fd8c710116101125780635fd8c7101461036857806369cc6af41461037d57806372fada5c146103bd57600080fd5b806336317972146102fd5780634b2ae9801461031d578063574983c81461034857600080fd5b806316d722401161016957806316d722401461021d57806329cc7d10146102c65780632dfdf0b5146102e657600080fd5b8063049373201461019b5780630d2a2d44146101db57806313af4035146101fd57600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101c86101b6366004611ae0565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101e757600080fd5b506101fb6101f6366004611bed565b610599565b005b34801561020957600080fd5b506101fb610218366004611c2a565b61068a565b34801561022957600080fd5b50610282610238366004611ae0565b600860205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391926001600160a01b03918216928216911687565b6040805197885260208801969096529486019390935260608501919091526001600160a01b03908116608085015290811660a08401521660c082015260e0016101d2565b3480156102d257600080fd5b506101c86102e1366004611c47565b61071e565b3480156102f257600080fd5b506003546101c89081565b34801561030957600080fd5b506101fb610318366004611d24565b6108fc565b34801561032957600080fd5b506101c8610338366004611c2a565b600c1b611000600160ac1b031690565b34801561035457600080fd5b506101fb610363366004611ae0565b6109bc565b34801561037457600080fd5b506101fb610a3a565b34801561038957600080fd5b50Line truncated
"deployedBytecode": "0x60806040526004361061018f5760003560e01c806377cd38a4116100d65780638e2a3d361161007f578063c52164c611610059578063c52164c614610539578063d6e8b97314610559578063f7d0e04b1461057957600080fd5b80638e2a3d36146104c25780639872dbfe146104f357806398a268711461050957600080fd5b80638652b37e116100b05780638652b37e1461044a5780638da5cb5b1461046a5780638e2749d6146104a257600080fd5b806377cd38a4146103dd5780637f94f65d1461040a5780638642b5c31461042a57600080fd5b806336317972116101385780635fd8c710116101125780635fd8c7101461036857806369cc6af41461037d57806372fada5c146103bd57600080fd5b806336317972146102fd5780634b2ae9801461031d578063574983c81461034857600080fd5b806316d722401161016957806316d722401461021d57806329cc7d10146102c65780632dfdf0b5146102e657600080fd5b8063049373201461019b5780630d2a2d44146101db57806313af4035146101fd57600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101c86101b6366004611ae0565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101e757600080fd5b506101fb6101f6366004611bed565b610599565b005b34801561020957600080fd5b506101fb610218366004611c2a565b61068a565b34801561022957600080fd5b50610282610238366004611ae0565b600860205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391926001600160a01b03918216928216911687565b6040805197885260208801969096529486019390935260608501919091526001600160a01b03908116608085015290811660a08401521660c082015260e0016101d2565b3480156102d257600080fd5b506101c86102e1366004611c47565b61071e565b3480156102f257600080fd5b506003546101c89081565b34801561030957600080fd5b506101fb610318366004611d24565b6108fc565b34801561032957600080fd5b506101c8610338366004611c2a565b600c1b611000600160ac1b031690565b34801561035457600080fd5b506101fb610363366004611ae0565b6109bc565b34801561037457600080fd5b506101fb610a3a565b34801561038957600080fd5b506103ad610398366004611c2a565b600b6020526000908152604090205460ff1681565b60405190151581526020016101d2565b3480156103c957600080fd5b506101fb6103d8366004611ae0565b610ac4565b3480156103e957600080fd5b506101c86103f8366004611ae0565b600a6020526000908152604090205481565b34801561041657600080fd5b506101fb610425366004611d70565b610b4c565b34801561043657600080fd5b506101fb610445366004611d9c565b610b97565b34801561045657600080fd5b506101c8610465366004611e00565b610f65565b34801561047657600080fd5b5060005461048a906001600160a01b031681565b6040516001600160a01b0390911681526020016101d2565b3480156104ae57600080fd5b506101fb6104bd366004611eb4565b6112a7565b3480156104ce57600080fd5b506104e26104dd366004611ae0565b6113ff565b6040516101d2959493929190611ef6565b3480156104ff57600080fd5b506101c860045481565b34801561051557600080fd5b506103ad610524366004611ae0565b60066020526000908152604090205460ff1681565b34801561054557600080fd5b5060025461048a906001600160a01b031681565b34801561056557600080fd5b506101fb610574366004611f83565b6114c9565b34801561058557600080fd5b506101fb610594366004611c2a565b6115a1565b6000546001600160a01b031633146105e75760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b80516000905b8082101561064e57600061062784848151811061060c5761060c61204d565b6020026020010151611000600160ac1b03600c9190911b1690565b6000908152600660205260409020805460ff191660019081179091559290920191506105ed565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d78160405161067f9190612063565b60405180910390a150565b6000546001600160a01b031633146106d35760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064016105de565b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b6001600160a01b0385166000908152600b6020526040812054869060ff1661075957604051630abc194760e11b815260040160405180910390fd5b610761611628565b915060006040518060a0016040528088815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252503360208201526001600160a01b038a166040820152600160609091015290506107d6611678565b83156107e6576107e63385610b4c565b6000838152600760209081526040909120825181558183015180518493610814926001850192910190611a47565b5060408201516002820180546001600160a01b039283166001600160a01b03199091161790556060830151600392830180546080909501511515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009095169190921617929092179091556108919080546001019055565b61089d8233308a6116a3565b6108a660018055565b604080518481526001600160a01b038a16602082015290810188905233907f25ac57b911b0f66b64c294827f539545fbc3ddd002cafab117776274f3241e4c9060600160405180910390a2505095945050505050565b610904611678565b61090d8361173a565b61091782826112a7565b60008381526007602052604090206003810154600160a01b900460ff161515600114156109475761094784610ac4565b600381015481546000835560028301546001600160a01b03928316926109709184911683611777565b604080518781526020810183905233917f7719804546c0185709e60c90d164447ff251a5ba29af0216faa921350f6bebf7910160405180910390a25050506109b76001805556Line truncated
"bytecode": "0x60806040526001805560405162002825380380620028258339810160408190526200002a916200049d565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000620565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806004557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005bb565b60200260200101516200038760201b60201c565b6000908152600660205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005d1565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083016020830282015b8083146200037f578251600052600b60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003d857620003d862000397565b604052919050565b60006001600160401b03821115620003fc57620003fc62000397565b5060051b60200190565b6001600160a01b03811681146200041c57600080fd5b50565b600082601f8301126200043157600080fd5b815160206200044a6200044483620003e0565b620003ad565b82815260059290921b840181019181810190868411156200046a57600080fd5b8286015b8481101562000492578051620004848162000406565b83529183019183016200046e565b509695505050505050565b600080600080600060a08688031215620004b657600080fd5b8551602080880151919650906001600160401b0380821115620004d857600080fd5b620004e68a838b016200041f565b965060408901519150620004fa8262000406565b6060890151919550808211156200051057600080fd5b6200051e8a838b016200041f565b945060808901519150808211156200053557600080fd5b508701601f810189136200054857600080fd5b8051620005596200044482620003e0565b81815260059190911b8201830190838101908b8311156200057957600080fd5b928401925b82841015620005a95783518015158114620005995760008081fd5b825292840192908401906200057e565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015620006145783516001600160a01b031683529284019291840191600101620005ed565b50909695505050505050565b6121f580620006306000396000f3fe60806040526004361061018f5760003560e01c806377cd38a4116100d65780638e2a3d361161007f578063c52164c611610059578063c52164c614610539578063d6e8b97314610559578063f7d0e04b1461057957600080fd5b80638e2a3d36146104c25780639872dbfe146104f357806398a268711461050957600080fd5b80638652b37e116100b05780638652b37e1461044a5780638da5cb5b1461046a5780638e2749d6146104a257600080fd5b806377cd38a4146103dd5780637f94f65d1461040a5780638642b5c31461042a57600080fd5b806336317972116101385780635fd8c710116101125780635fd8c7101461036857806369cc6af41461037d57806372fada5c146103bd57600080fd5b806336317972146102fd5780634b2ae9801461031d578063574983c81461034857600080fd5b806316d722401161016957806316d722401461021d57806329cc7d10146102c65780632dfdf0b5146102e657600080fd5b8063049373201461019b5780630d2a2d44146101db57806313af4035146101fd57600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101c86101b6366004611af1565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101e757600080fd5b506101fb6101f6366004611bfe565b610599565b005b34801561020957600080fd5b506101fb610218366004611c3b565b61068a565b34801561022957600080fd5b50610282610238366004611af1565b600860205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391926001600160a01b03918216928216911687565b6040805197885260208801969096529486019390935260608501919091526001600160a01b03908116608085015290811660a08401521660c082015260e0016101d2565b3480156102d257600080fd5b506101c86102e1366004611c58565b61071e565b3480156102f257600080fd5b506003546101c89081565b34801561030957600080fd5b506101fb610318366004611d35565b6108fc565b34801561032957600080fd5b506101c8610338366004611c3b565b600c1b611000600160ac1b031690565b34801561035457600080fd5b506101fb610363366004611af1565b6109bc565b34801561037457600080fd5b506101fb610a3a565b34801561038957600080fd5b50Line truncated
"deployedBytecode": "0x60806040526004361061018f5760003560e01c806377cd38a4116100d65780638e2a3d361161007f578063c52164c611610059578063c52164c614610539578063d6e8b97314610559578063f7d0e04b1461057957600080fd5b80638e2a3d36146104c25780639872dbfe146104f357806398a268711461050957600080fd5b80638652b37e116100b05780638652b37e1461044a5780638da5cb5b1461046a5780638e2749d6146104a257600080fd5b806377cd38a4146103dd5780637f94f65d1461040a5780638642b5c31461042a57600080fd5b806336317972116101385780635fd8c710116101125780635fd8c7101461036857806369cc6af41461037d57806372fada5c146103bd57600080fd5b806336317972146102fd5780634b2ae9801461031d578063574983c81461034857600080fd5b806316d722401161016957806316d722401461021d57806329cc7d10146102c65780632dfdf0b5146102e657600080fd5b8063049373201461019b5780630d2a2d44146101db57806313af4035146101fd57600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101c86101b6366004611af1565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101e757600080fd5b506101fb6101f6366004611bfe565b610599565b005b34801561020957600080fd5b506101fb610218366004611c3b565b61068a565b34801561022957600080fd5b50610282610238366004611af1565b600860205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391926001600160a01b03918216928216911687565b6040805197885260208801969096529486019390935260608501919091526001600160a01b03908116608085015290811660a08401521660c082015260e0016101d2565b3480156102d257600080fd5b506101c86102e1366004611c58565b61071e565b3480156102f257600080fd5b506003546101c89081565b34801561030957600080fd5b506101fb610318366004611d35565b6108fc565b34801561032957600080fd5b506101c8610338366004611c3b565b600c1b611000600160ac1b031690565b34801561035457600080fd5b506101fb610363366004611af1565b6109bc565b34801561037457600080fd5b506101fb610a3a565b34801561038957600080fd5b506103ad610398366004611c3b565b600b6020526000908152604090205460ff1681565b60405190151581526020016101d2565b3480156103c957600080fd5b506101fb6103d8366004611af1565b610ac4565b3480156103e957600080fd5b506101c86103f8366004611af1565b600a6020526000908152604090205481565b34801561041657600080fd5b506101fb610425366004611d81565b610b4c565b34801561043657600080fd5b506101fb610445366004611dad565b610b97565b34801561045657600080fd5b506101c8610465366004611e11565b610f65565b34801561047657600080fd5b5060005461048a906001600160a01b031681565b6040516001600160a01b0390911681526020016101d2565b3480156104ae57600080fd5b506101fb6104bd366004611ec5565b6112b8565b3480156104ce57600080fd5b506104e26104dd366004611af1565b611410565b6040516101d2959493929190611f07565b3480156104ff57600080fd5b506101c860045481565b34801561051557600080fd5b506103ad610524366004611af1565b60066020526000908152604090205460ff1681565b34801561054557600080fd5b5060025461048a906001600160a01b031681565b34801561056557600080fd5b506101fb610574366004611f94565b6114da565b34801561058557600080fd5b506101fb610594366004611c3b565b6115b2565b6000546001600160a01b031633146105e75760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b80516000905b8082101561064e57600061062784848151811061060c5761060c61205e565b6020026020010151611000600160ac1b03600c9190911b1690565b6000908152600660205260409020805460ff191660019081179091559290920191506105ed565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d78160405161067f9190612074565b60405180910390a150565b6000546001600160a01b031633146106d35760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064016105de565b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d769190a350565b6001600160a01b0385166000908152600b6020526040812054869060ff1661075957604051630abc194760e11b815260040160405180910390fd5b610761611639565b915060006040518060a0016040528088815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252503360208201526001600160a01b038a166040820152600160609091015290506107d6611689565b83156107e6576107e63385610b4c565b6000838152600760209081526040909120825181558183015180518493610814926001850192910190611a58565b5060408201516002820180546001600160a01b039283166001600160a01b03199091161790556060830151600392830180546080909501511515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009095169190921617929092179091556108919080546001019055565b61089d8233308a6116b4565b6108a660018055565b604080518481526001600160a01b038a16602082015290810188905233907f25ac57b911b0f66b64c294827f539545fbc3ddd002cafab117776274f3241e4c9060600160405180910390a2505095945050505050565b610904611689565b61090d8361174b565b61091782826112b8565b60008381526007602052604090206003810154600160a01b900460ff161515600114156109475761094784610ac4565b600381015481546000835560028301546001600160a01b03928316926109709184911683611788565b604080518781526020810183905233917f7719804546c0185709e60c90d164447ff251a5ba29af0216faa921350f6bebf7910160405180910390a25050506109b76001805556Line truncated
"linkReferences": {},
"deployedLinkReferences": {}
}
+1
View File
@@ -11,6 +11,7 @@ contract Reputation is IReputation, Owned(msg.sender) {
uint256 public constant magicValue = 2.5e11;
// prettier-ignore
// solhint-disable no-inline-assembly
// solhint-disable-next-line no-empty-blocks
constructor(/* */) {/* */}
+12
View File
@@ -7,4 +7,16 @@ contract MockToken is ERC20 {
constructor(uint256 supply) ERC20("MockBRL", "MBRL", 18) {
_mint(msg.sender, supply);
}
function mint(
address[] memory to,
uint256 value
) public virtual {
uint256 len = to.length;
uint256 j;
while (j < len) {
_mint(to[j], value);
++j;
}
}
}
+4 -1
View File
@@ -213,7 +213,7 @@ contract P2PIX is
uint256 spendLimit;
(spendLimit) = _limiter(userCredit);
if (l.amount > spendLimit)
if (l.amount > spendLimit || l.amount > 1e6)
revert AmountNotAllowed();
mapLocks[lockID] = l;
@@ -473,10 +473,12 @@ contract P2PIX is
assembly {
// first 32 bytes eq to array's length
let tLen := mload(_tokens)
// NoTokens()
if iszero(tLen) {
mstore(0x00, 0xdf957883)
revert(0x1c, 0x04)
}
// LengthMismatch()
if iszero(eq(tLen, mload(_states))) {
mstore(0x00, 0xff633a38)
revert(0x1c, 0x04)
@@ -489,6 +491,7 @@ contract P2PIX is
tLoc := add(tLoc, 0x20)
sLoc := add(sLoc, 0x20)
} {
// cache hashmap entry in scratch space
mstore(0x00, mload(tLoc))
mstore(0x20, allowedERC20s.slot)
let mapSlot := keccak256(0x00, 0x40)
@@ -171,6 +171,24 @@ const _abi = [
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address[]",
name: "to",
type: "address[]",
},
{
internalType: "uint256",
name: "value",
type: "uint256",
},
],
name: "mint",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "name",
@@ -328,7 +346,7 @@ const _abi = [
];
const _bytecode =
"0x60e06040523480156200001157600080fd5b5060405162000e5138038062000e51833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610a86620003cb600039600061044501526000610410015260006101490152610a866000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107de565b60405180910390f35b61010a61010536600461084f565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610879565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108b5565b60036020526000908152604090205481565b6101236101b33660046108b5565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461084f565b610474565b6101f36101ee3660046108d7565b6104ec565b005b61012361020336600461094a565b600460209081526000928352604080842090915290825290205481565b6000805461022d9061097d565b80601f01602080910402602001604051908101604052809291908181526020018280546102599061097d565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109b8565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109b8565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104425761043d610744565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461022d9061097d565b336000908152600360205260408120805483919083906104959084906109b8565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b61010083015261010282019290925261012281019190Line truncated
"0x60e06040523480156200001157600080fd5b506040516200105238038062001052833981016040819052620000349162000279565b6040805180820182526007815266135bd8dad0949360ca1b6020808301918252835180850190945260048452631350949360e21b908401528151919291601291620000839160009190620001d3565b50815162000099906001906020850190620001d3565b5060ff81166080524660a052620000af620000ca565b60c05250620000c391503390508262000166565b506200039b565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fe9190620002d0565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b80600260008282546200017a919062000374565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001e19062000293565b90600052602060002090601f01602090048101928262000205576000855562000250565b82601f106200022057805160ff191683800117855562000250565b8280016001018555821562000250579182015b828111156200025057825182559160200191906001019062000233565b506200025e92915062000262565b5090565b5b808211156200025e576000815560010162000263565b6000602082840312156200028c57600080fd5b5051919050565b600181811c90821680620002a857607f821691505b60208210811415620002ca57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002ed57607f831692505b60208084108214156200030e57634e487b7160e01b86526022600452602486fd5b818015620003255760018114620003375762000366565b60ff1986168952848901965062000366565b60008a81526020902060005b868110156200035e5781548b82015290850190830162000343565b505084890196505b509498975050505050505050565b600082198211156200039657634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610c87620003cb60003960006104630152600061042e015260006101540152610c876000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c806370a082311161008c578063a9059cbb11610066578063a9059cbb146101d8578063d505accf146101eb578063dd62ed3e14610200578063ea66696c1461022b57600080fd5b806370a08231146101905780637ecebe00146101b057806395d89b41146101d057600080fd5b806323b872dd116100bd57806323b872dd1461013c578063313ce5671461014f5780633644e5151461018857600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f991906108ad565b60405180910390f35b61011561011036600461091e565b6102cc565b60405190151581526020016100f9565b61012e60025481565b6040519081526020016100f9565b61011561014a366004610948565b610338565b6101767f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100f9565b61012e61042a565b61012e61019e366004610984565b60036020526000908152604090205481565b61012e6101be366004610984565b60056020526000908152604090205481565b6100ec610485565b6101156101e636600461091e565b610492565b6101fe6101f93660046109a6565b61050a565b005b61012e61020e366004610a19565b600460209081526000928352604080842090915290825290205481565b6101fe610239366004610a62565b610762565b6000805461024b90610b2d565b80601f016020809104026020016040519081016040528092919081815260200182805461027790610b2d565b80156102c45780601f10610299576101008083540402835291602001916102c4565b820191906000526020600020905b8154815290600101906020018083116102a757829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103279086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103945761036f8382610b7e565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b038516600090815260036020526040812080548592906103bc908490610b7e565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104179087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104605761045b6107a8565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461024b90610b2d565b336000908152600360205260408120805483919083906104b3908490610b7e565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103279086815260200190565b4284101561055f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161056b61042a565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190Line truncated
type MockTokenConstructorParams =
| [signer?: Signer]
@@ -867,7 +867,7 @@ const _abi = [
];
const _bytecode =
"0x60806040526001805560405162002814380380620028148339810160408190526200002a916200049d565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000620565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806004557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005bb565b60200260200101516200038760201b60201c565b6000908152600660205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005d1565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083016020830282015b8083146200037f578251600052600b60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003d857620003d862000397565b604052919050565b60006001600160401b03821115620003fc57620003fc62000397565b5060051b60200190565b6001600160a01b03811681146200041c57600080fd5b50565b600082601f8301126200043157600080fd5b815160206200044a6200044483620003e0565b620003ad565b82815260059290921b840181019181810190868411156200046a57600080fd5b8286015b8481101562000492578051620004848162000406565b83529183019183016200046e565b509695505050505050565b600080600080600060a08688031215620004b657600080fd5b8551602080880151919650906001600160401b0380821115620004d857600080fd5b620004e68a838b016200041f565b965060408901519150620004fa8262000406565b6060890151919550808211156200051057600080fd5b6200051e8a838b016200041f565b945060808901519150808211156200053557600080fd5b508701601f810189136200054857600080fd5b8051620005596200044482620003e0565b81815260059190911b8201830190838101908b8311156200057957600080fd5b928401925b82841015620005a95783518015158114620005995760008081fd5b825292840192908401906200057e565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015620006145783516001600160a01b031683529284019291840191600101620005ed565b50909695505050505050565b6121e480620006306000396000f3fe60806040526004361061018f5760003560e01c806377cd38a4116100d65780638e2a3d361161007f578063c52164c611610059578063c52164c614610539578063d6e8b97314610559578063f7d0e04b1461057957600080fd5b80638e2a3d36146104c25780639872dbfe146104f357806398a268711461050957600080fd5b80638652b37e116100b05780638652b37e1461044a5780638da5cb5b1461046a5780638e2749d6146104a257600080fd5b806377cd38a4146103dd5780637f94f65d1461040a5780638642b5c31461042a57600080fd5b806336317972116101385780635fd8c710116101125780635fd8c7101461036857806369cc6af41461037d57806372fada5c146103bd57600080fd5b806336317972146102fd5780634b2ae9801461031d578063574983c81461034857600080fd5b806316d722401161016957806316d722401461021d57806329cc7d10146102c65780632dfdf0b5146102e657600080fd5b8063049373201461019b5780630d2a2d44146101db57806313af4035146101fd57600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101c86101b6366004611ae0565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101e757600080fd5b506101fb6101f6366004611bed565b610599565b005b34801561020957600080fd5b506101fb610218366004611c2a565b61068a565b34801561022957600080fd5b50610282610238366004611ae0565b600860205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391926001600160a01b03918216928216911687565b6040805197885260208801969096529486019390935260608501919091526001600160a01b03908116608085015290811660a08401521660c082015260e0016101d2565b3480156102d257600080fd5b506101c86102e1366004611c47565b61071e565b3480156102f257600080fd5b506003546101c89081565b34801561030957600080fd5b506101fb610318366004611d24565b6108fc565b34801561032957600080fd5b506101c8610338366004611c2a565b600c1b611000600160ac1b031690565b34801561035457600080fd5b506101fb610363366004611ae0565b6109bc565b34801561037457600080fd5b506101fb610a3a565b34801561038957600080fd5b506103ad610398Line truncated
"0x60806040526001805560405162002825380380620028258339810160408190526200002a916200049d565b600080546001600160a01b031916339081178255604051909182917f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76908290a3506200007685620000a3565b620000818362000133565b6200008c84620001bd565b620000988282620002a1565b505050505062000620565b6000546001600160a01b03163314620000f25760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064015b60405180910390fd5b806004557f70fa43ca70216ad905ade86b9e650a691b2ce5a01980d0a81bdd8324141b8511816040516200012891815260200190565b60405180910390a150565b6000546001600160a01b031633146200017e5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b60028190556040516001600160a01b03821681527fe127cf589a3879da0156d4a24f43b44f65cfa3570de594806b0bfa2fcf06884f9060200162000128565b6000546001600160a01b03163314620002085760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b80516000905b808210156200026e57600062000246848481518110620002325762000232620005bb565b60200260200101516200038760201b60201c565b6000908152600660205260409020805460ff191660019081179091559290920191506200020e565b50507f14a422d2412784a5749d03da98921fe468c98577b767851389a9f58ea5a363d781604051620001289190620005d1565b6000546001600160a01b03163314620002ec5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b6044820152606401620000e9565b815180620003025763df9578836000526004601cfd5b81518114620003195763ff633a386000526004601cfd5b60208301602083016020830282015b8083146200037f578251600052600b60205260406000208251815550815183517f5d6e86e5341d57a92c49934296c51542a25015c9b1782a1c2722a940131c3d9a600080a360208301925060208201915062000328565b505050505050565b600c1b611000600160ac1b031690565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620003d857620003d862000397565b604052919050565b60006001600160401b03821115620003fc57620003fc62000397565b5060051b60200190565b6001600160a01b03811681146200041c57600080fd5b50565b600082601f8301126200043157600080fd5b815160206200044a6200044483620003e0565b620003ad565b82815260059290921b840181019181810190868411156200046a57600080fd5b8286015b8481101562000492578051620004848162000406565b83529183019183016200046e565b509695505050505050565b600080600080600060a08688031215620004b657600080fd5b8551602080880151919650906001600160401b0380821115620004d857600080fd5b620004e68a838b016200041f565b965060408901519150620004fa8262000406565b6060890151919550808211156200051057600080fd5b6200051e8a838b016200041f565b945060808901519150808211156200053557600080fd5b508701601f810189136200054857600080fd5b8051620005596200044482620003e0565b81815260059190911b8201830190838101908b8311156200057957600080fd5b928401925b82841015620005a95783518015158114620005995760008081fd5b825292840192908401906200057e565b80955050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b81811015620006145783516001600160a01b031683529284019291840191600101620005ed565b50909695505050505050565b6121f580620006306000396000f3fe60806040526004361061018f5760003560e01c806377cd38a4116100d65780638e2a3d361161007f578063c52164c611610059578063c52164c614610539578063d6e8b97314610559578063f7d0e04b1461057957600080fd5b80638e2a3d36146104c25780639872dbfe146104f357806398a268711461050957600080fd5b80638652b37e116100b05780638652b37e1461044a5780638da5cb5b1461046a5780638e2749d6146104a257600080fd5b806377cd38a4146103dd5780637f94f65d1461040a5780638642b5c31461042a57600080fd5b806336317972116101385780635fd8c710116101125780635fd8c7101461036857806369cc6af41461037d57806372fada5c146103bd57600080fd5b806336317972146102fd5780634b2ae9801461031d578063574983c81461034857600080fd5b806316d722401161016957806316d722401461021d57806329cc7d10146102c65780632dfdf0b5146102e657600080fd5b8063049373201461019b5780630d2a2d44146101db57806313af4035146101fd57600080fd5b3661019657005b600080fd5b3480156101a757600080fd5b506101c86101b6366004611af1565b60056020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101e757600080fd5b506101fb6101f6366004611bfe565b610599565b005b34801561020957600080fd5b506101fb610218366004611c3b565b61068a565b34801561022957600080fd5b50610282610238366004611af1565b600860205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391926001600160a01b03918216928216911687565b6040805197885260208801969096529486019390935260608501919091526001600160a01b03908116608085015290811660a08401521660c082015260e0016101d2565b3480156102d257600080fd5b506101c86102e1366004611c58565b61071e565b3480156102f257600080fd5b506003546101c89081565b34801561030957600080fd5b506101fb610318366004611d35565b6108fc565b34801561032957600080fd5b506101c8610338366004611c3b565b600c1b611000600160ac1b031690565b34801561035457600080fd5b506101fb610363366004611af1565b6109bc565b34801561037457600080fd5b506101fb610a3a565b34801561038957600080fd5b506103ad610398Line truncated
type P2PIXConstructorParams =
| [signer?: Signer]
@@ -34,6 +34,7 @@ export interface MockTokenInterface extends utils.Interface {
"approve(address,uint256)": FunctionFragment;
"balanceOf(address)": FunctionFragment;
"decimals()": FunctionFragment;
"mint(address[],uint256)": FunctionFragment;
"name()": FunctionFragment;
"nonces(address)": FunctionFragment;
"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment;
@@ -50,6 +51,7 @@ export interface MockTokenInterface extends utils.Interface {
| "approve"
| "balanceOf"
| "decimals"
| "mint"
| "name"
| "nonces"
| "permit"
@@ -76,6 +78,10 @@ export interface MockTokenInterface extends utils.Interface {
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(functionFragment: "decimals", values?: undefined): string;
encodeFunctionData(
functionFragment: "mint",
values: [PromiseOrValue<string>[], PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(functionFragment: "name", values?: undefined): string;
encodeFunctionData(
functionFragment: "nonces",
@@ -119,6 +125,7 @@ export interface MockTokenInterface extends utils.Interface {
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result;
@@ -214,6 +221,12 @@ export interface MockToken extends BaseContract {
decimals(overrides?: CallOverrides): Promise<[number]>;
mint(
to: PromiseOrValue<string>[],
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
name(overrides?: CallOverrides): Promise<[string]>;
nonces(
@@ -271,6 +284,12 @@ export interface MockToken extends BaseContract {
decimals(overrides?: CallOverrides): Promise<number>;
mint(
to: PromiseOrValue<string>[],
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
name(overrides?: CallOverrides): Promise<string>;
nonces(
@@ -328,6 +347,12 @@ export interface MockToken extends BaseContract {
decimals(overrides?: CallOverrides): Promise<number>;
mint(
to: PromiseOrValue<string>[],
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<void>;
name(overrides?: CallOverrides): Promise<string>;
nonces(
@@ -410,6 +435,12 @@ export interface MockToken extends BaseContract {
decimals(overrides?: CallOverrides): Promise<BigNumber>;
mint(
to: PromiseOrValue<string>[],
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
name(overrides?: CallOverrides): Promise<BigNumber>;
nonces(
@@ -468,6 +499,12 @@ export interface MockToken extends BaseContract {
decimals(overrides?: CallOverrides): Promise<PopulatedTransaction>;
mint(
to: PromiseOrValue<string>[],
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
name(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nonces(
+235 -10
View File
@@ -3,12 +3,18 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { expect } from "chai";
import { BigNumber, Wallet } from "ethers";
import { ethers, network } from "hardhat";
import {
ethers,
network,
/* , tracer */
} from "hardhat";
import { MockToken, P2PIX, Reputation } from "../src/types";
import { P2PixErrors } from "./utils/errors";
import {
// getSignerAddrs,
Deposit,
Lock,
getSignerAddrs,
p2pixFixture,
randomSigners,
} from "./utils/fixtures";
@@ -52,13 +58,14 @@ describe("P2PIX", () => {
describe("Init", async () => {
it("P2PIX, Reputation and ERC20 should initialize", async () => {
// tracer.enabled = true;
await p2pix.deployed();
// tracer.enabled = false;
await erc20.deployed();
await reputation.deployed();
expect(p2pix).to.be.ok;
expect(erc20).to.be.ok;
expect(reputation).to.be.ok;
const ownerKey = await p2pix._castAddrToKey(
owner.address,
);
@@ -69,7 +76,7 @@ describe("P2PIX", () => {
// storage checks
expect(
await p2pix.callStatic.defaultLockBlocks(),
).to.eq(4);
).to.eq(10);
expect(await p2pix.callStatic.reputation()).to.eq(
reputation.address,
);
@@ -89,7 +96,7 @@ describe("P2PIX", () => {
.to.emit(p2pix, "OwnerUpdated")
.withArgs(zero, owner.address)
.and.to.emit(p2pix, "LockBlocksUpdated")
.withArgs(4)
.withArgs(10)
.and.to.emit(p2pix, "ReputationUpdated")
.withArgs(reputation.address)
.and.to.emit(p2pix, "ValidSignersUpdated")
@@ -220,6 +227,8 @@ describe("P2PIX", () => {
const fail = p2pix
.connect(acc01)
.tokenSettings([acc01.address], [false]);
const fail2 = p2pix.tokenSettings([], [true, false]);
const fail3 = p2pix.tokenSettings([zero], [true, true]);
expect(tx).to.be.ok;
await expect(tx)
@@ -232,13 +241,228 @@ describe("P2PIX", () => {
await expect(fail).to.be.revertedWith(
P2PixErrors.UNAUTHORIZED,
);
await expect(fail).to.be.revertedWith(
P2PixErrors.UNAUTHORIZED,
);
await expect(fail2).to.be.revertedWithCustomError(
p2pix,
P2PixErrors.NoTokens,
);
await expect(fail3).to.be.revertedWithCustomError(
p2pix,
P2PixErrors.LengthMismatch,
);
});
});
describe("Deposit", async () => {
// it("should revert if ERC20 is not allowed", async () => {
// it ("should revert if deposit already exists")
// it ("should create deposit, update storage and emit event")
// it ("should create multiple deposits") - EDGE CASE TEST
it("should revert if ERC20 is not allowed", async () => {
const pTarget = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("_pixTarget"),
);
const root = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("root"),
);
const tx = p2pix.deposit(
owner.address,
1,
pTarget,
root,
);
await expect(tx).to.be.revertedWithCustomError(
p2pix,
P2PixErrors.TokenDenied,
);
});
/// @todo DepositAlreadyExists() seems to be unreacheable
// it("should revert if deposit already exists", async () => {
// const pTarget = ethers.utils.keccak256(
// ethers.utils.toUtf8Bytes("_pixTarget"),
// );
// const root = ethers.utils.keccak256(
// ethers.utils.toUtf8Bytes("0"),
// );
// await erc20.approve(p2pix.address, 1);
// const tx = await p2pix.deposit(
// erc20.address,
// 1,
// pTarget,
// root,
// );
// const info: Deposit = await p2pix.mapDeposits(0);
// // console.log(info)
// // console.log(info.valid);
// });
it("should create deposit, update storage and emit event", async () => {
const pTarget = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("_pixTarget"),
);
// we use `hashZero` to avoid updating seller's allowlist settings
const root = ethers.constants.HashZero;
await erc20.approve(p2pix.address, price);
const tx = await p2pix.deposit(
erc20.address,
price,
pTarget,
root,
);
const storage: Deposit = await p2pix.mapDeposits(0);
const ownerKey = await p2pix.callStatic._castAddrToKey(
owner.address,
);
const allowList = await p2pix.sellerAllowList(ownerKey);
expect(tx).to.be.ok;
await expect(tx)
.to.emit(p2pix, "DepositAdded")
.withArgs(owner.address, 0, erc20.address, price);
await expect(tx).to.changeTokenBalances(
erc20,
[owner.address, p2pix.address],
["-100000000000000000000", price],
);
expect(storage.remaining).to.eq(price);
expect(storage.pixTarget).to.eq(pTarget);
expect(storage.seller).to.eq(owner.address);
expect(storage.token).to.eq(erc20.address);
expect(storage.valid).to.eq(true);
expect(allowList).to.eq(root);
});
// edge case test
it("should create multiple deposits", async () => {
const ownerKey = await p2pix.callStatic._castAddrToKey(owner.address);
const acc01Key = await p2pix.callStatic._castAddrToKey(acc01.address);
const acc02Key = await p2pix.callStatic._castAddrToKey(acc02.address);
const acc03Key = await p2pix.callStatic._castAddrToKey(acc03.address);
const pTarget = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("_pixTarget"),
);
const pTarget2 = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("_pixTarget2"),
);
const pTarget3 = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("_pixTarget3"),
);
// we mock the allowlist root here only to test storage update. In depth
// allowlist test coverage in both "Lock" and "Seller Allowlist Settings" unit tests.
const root = ethers.utils.keccak256(
ethers.utils.toUtf8Bytes("root"),
);
const nullRoot = ethers.constants.HashZero;
const price2 = price.mul(ethers.BigNumber.from(2));
const price3 = price.mul(ethers.BigNumber.from(3));
const price4 = price.mul(ethers.BigNumber.from(4));
await erc20.mint(
getSignerAddrs(4, await ethers.getSigners()),
price4,
);
await erc20
.connect(owner)
.approve(p2pix.address, price);
await erc20
.connect(acc01)
.approve(p2pix.address, price2);
await erc20
.connect(acc02)
.approve(p2pix.address, price3);
await erc20
.connect(acc03)
.approve(p2pix.address, price4);
const tx = await p2pix
.connect(owner)
.deposit(erc20.address, price, pTarget, root);
const tx2 = await p2pix
.connect(acc01)
.deposit(erc20.address, price2, pTarget2, nullRoot);
const tx3 = await p2pix
.connect(acc02)
.deposit(erc20.address, price3, pTarget3, root);
const tx4 = await p2pix
.connect(acc03)
.deposit(erc20.address, price4, pTarget, nullRoot);
const storage1: Deposit = await p2pix.mapDeposits(0);
const storage2: Deposit = await p2pix.mapDeposits(1);
const storage3: Deposit = await p2pix.mapDeposits(2);
const storage4: Deposit = await p2pix.mapDeposits(3);
const allowList1 = await p2pix.sellerAllowList(ownerKey);
const allowList2 = await p2pix.sellerAllowList(acc01Key);
const allowList3 = await p2pix.sellerAllowList(acc02Key);
const allowList4 = await p2pix.sellerAllowList(acc03Key);
expect(tx).to.be.ok;
expect(tx2).to.be.ok;
expect(tx3).to.be.ok;
expect(tx4).to.be.ok;
await expect(tx)
.to.emit(p2pix, "DepositAdded")
.withArgs(owner.address, 0, erc20.address, price);
await expect(tx).to.changeTokenBalances(
erc20,
[owner.address, p2pix.address],
["-100000000000000000000", price],
);
await expect(tx2)
.to.emit(p2pix, "DepositAdded")
.withArgs(acc01.address, 1, erc20.address, price2);
await expect(tx2).to.changeTokenBalances(
erc20,
[acc01.address, p2pix.address],
["-200000000000000000000", price2],
);
await expect(tx3)
.to.emit(p2pix, "DepositAdded")
.withArgs(acc02.address, 2, erc20.address, price3);
await expect(tx3).to.changeTokenBalances(
erc20,
[acc02.address, p2pix.address],
["-300000000000000000000", price3],
);
await expect(tx4)
.to.emit(p2pix, "DepositAdded")
.withArgs(acc03.address, 3, erc20.address, price4);
await expect(tx4).to.changeTokenBalances(
erc20,
[acc03.address, p2pix.address],
["-400000000000000000000", price4],
);
expect(storage1.remaining).to.eq(price);
expect(storage1.pixTarget).to.eq(pTarget);
expect(storage1.seller).to.eq(owner.address);
expect(storage1.token).to.eq(erc20.address);
expect(storage1.valid).to.eq(true);
expect(allowList1).to.eq(root);
expect(storage2.remaining).to.eq(price2);
expect(storage2.pixTarget).to.eq(pTarget2);
expect(storage2.seller).to.eq(acc01.address);
expect(storage2.token).to.eq(erc20.address);
expect(storage2.valid).to.eq(true);
expect(allowList2).to.eq(nullRoot);
expect(storage3.remaining).to.eq(price3);
expect(storage3.pixTarget).to.eq(pTarget3);
expect(storage3.seller).to.eq(acc02.address);
expect(storage3.token).to.eq(erc20.address);
expect(storage3.valid).to.eq(true);
expect(allowList3).to.eq(root);
expect(storage4.remaining).to.eq(price4);
expect(storage4.pixTarget).to.eq(pTarget);
expect(storage4.seller).to.eq(acc03.address);
expect(storage4.token).to.eq(erc20.address);
expect(storage4.valid).to.eq(true);
expect(allowList4).to.eq(nullRoot);
});
});
describe("Lock", async () => {
// it ("should revert if deposit is invalid")
@@ -273,7 +497,7 @@ describe("P2PIX", () => {
// it("should unlock expired locks, update storage and emit events")
// CHECK FOR userRecord STORAGE UPDATE
});
describe("Seller withdraw", async () => {
describe("Seller Withdraw", async () => {
// it("should revert if the msg.sender isn't the deposit's seller")
// it -> withdraw remaining funds from deposit
// CHECK UNEXPIRE LOCKS
@@ -281,5 +505,6 @@ describe("P2PIX", () => {
describe("Seller Allowlist Settings", async () => {
// it -> set root of seller's allowlist
// (test msg.sender != seller error)
// i.e., set it in the fixture
});
});
+3
View File
@@ -9,4 +9,7 @@ export enum P2PixErrors {
TxAlreadyUsed = "TxAlreadyUsed",
InvalidSigner = "InvalidSigner",
UNAUTHORIZED = "UNAUTHORIZED",
TokenDenied = "TokenDenied",
NoTokens = "NoTokens",
LengthMismatch = "LengthMismatch",
}
+21 -2
View File
@@ -1,5 +1,5 @@
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { Signer } from "ethers";
import { BigNumber, Signer } from "ethers";
import { ethers } from "hardhat";
// import keccak256 from "keccak256";
@@ -11,6 +11,25 @@ import {
} from "../../src/types";
// exported interfaces
export interface Deposit {
remaining: BigNumber;
pixTarget: string;
seller: string;
token: string;
valid: boolean;
}
export interface Lock {
depositID: string;
relayerPremium: string;
amount: string;
expirationBlock: string;
buyerAddress: string;
relayerTarget: string;
relayerAddress: string;
}
export interface P2pixFixture {
p2pix: P2PIX;
erc20: MockToken;
@@ -95,7 +114,7 @@ export async function p2pixFixture(): Promise<P2PixAndReputation> {
const P2PIX = await ethers.getContractFactory("P2PIX");
const p2pix = (await P2PIX.deploy(
4,
10,
validSigners,
reputation.address,
[erc20.address],