This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.
Try running some of the following tasks:
old token 0xA632d56b856d5933e6Ab96cF030428D8D443fDE9
new token 0x209C468504129754c1EFe73340D5392a6f9dD10E
swapper 0x66fDc060dA126E784d5363bC0296199346E4E9dd
0x608060405234801561001057600080fd5b506040516109d13803806109d183398101604081905261002f9161034d565b61003833610216565b600180546001600160a01b038086166001600160a01b0319928316811790935560028054918616919092161790556040805163313ce56760e01b8152905163313ce56791600480820192602092909190829003018186803b15801561009c57600080fd5b505afa1580156100b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d49190610390565b60ff1660091461012c5760405162461bcd60e51b815260206004820152602a60248201526000805160206109b18339815191526044820152696620536865726120563160b01b60648201526084015b60405180910390fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561017a57600080fd5b505afa15801561018e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b29190610390565b60ff166012146102055760405162461bcd60e51b815260206004820152602a60248201526000805160206109b1833981519152604482015269331029b432b930902b1960b11b6064820152608401610123565b61020e81610266565b5050506103ba565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146102c05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610123565b6001600160a01b0381166103255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610123565b61032e81610216565b50565b80516001600160a01b038116811461034857600080fd5b919050565b60008060006060848603121561036257600080fd5b61036b84610331565b925061037960208501610331565b915061038760408501610331565b90509250925092565b6000602082840312156103a257600080fd5b815160ff811681146103b357600080fd5b9392505050565b6105e8806103c96000396000f3fe6080604052600436106100405760003560e01c8063715018a6146100495780638da5cb5b1461005e578063bdf725991461008a578063f2fde38b1461009f57005b3661004757005b005b34801561005557600080fd5b506100476100bf565b34801561006a57600080fd5b50600054604080516001600160a01b039092168252519081900360200190f35b34801561009657600080fd5b5061004761012a565b3480156100ab57600080fd5b506100476100ba36600461051a565b6103ff565b6000546001600160a01b0316331461011e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61012860006104ca565b565b6000336001546040516370a0823160e01b81526001600160a01b038084166004830152929350600092909116906370a082319060240160206040518083038186803b15801561017857600080fd5b505afa15801561018c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b0919061056c565b9050600081116102135760405162461bcd60e51b815260206004820152602860248201527f536865657261537761707065723a2063616c6c657220646f65736e277420686f6044820152676c6420535443563160c01b6064820152608401610115565b6001546040516323b872dd60e01b81526001600160a01b03848116600483015230602483015260448201849052909116906323b872dd90606401602060405180830381600087803b15801561026757600080fd5b505af115801561027b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029f919061054a565b6102f65760405162461bcd60e51b815260206004820152602260248201527f536865657261537761707065723a206661696c6564207472616e7366657246726044820152616f6d60f01b6064820152608401610115565b6002546001600160a01b03166323b872dd6103196000546001600160a01b031690565b8461032885633b9aca00610585565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561037757600080fd5b505af115801561038b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103af919061054a565b6103fb5760405162461bcd60e51b815260206004820152601e60248201527f536865657261537761707065723a206661696c6564207472616e7366657200006044820152606401610115565b5050565b6000546001600160a01b031633146104595760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610115565b6001600160a01b0381166104be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610115565b6104c7816104ca565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561052c57600080fd5b81356001600160a01b038116811461054357600080fd5b9392505050565b60006020828403121561055c57600080fd5b8151801515811461054357600080fd5b60006020828403121561057e57600080fd5b5051919050565b60008160001904831182151516156105ad57634e487b7160e01b600052601160045260246000fd5b50029056fea2646970667358221220effa75c6d1f231b0f888ce310e72ede587fa81dfb37efd1b42a5f6bcc904600764736f6c63430008070033536865657261537761707065723a20696e76616c69642061646472657373206f000000000000000000000000a632d56b856d5933e6ab96cf030428d8d443fde9000000000000000000000000209c468504129754c1efe73340d5392a6f9dd10e000000000000000000000000e528289cbf3e3d80d9320711f8872488f5656da1
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help