From 00ddc1e4adacfdacae036fbb1a316d110ec51e3f Mon Sep 17 00:00:00 2001 From: Utkir S Date: Thu, 18 Aug 2022 16:21:23 +0500 Subject: [PATCH] feat: add hop protocol (#91) --- artifacts/HopFacet.json | 221 ++++ artifacts/IHopBridge.json | 102 ++ artifacts/console.json | 10 - config/hop.ts | 26 + deploy/206_deploy_hop_facet.ts | 47 + extensions/utils.ts | 2 + package-lock.json | 1511 ++++++++++++++++++++++ src/bridges/facets/HopFacet.sol | 209 +++ src/bridges/interfaces/IHopBridge.sol | 25 + test/bridges/HopFacet.ts | 187 +++ typings/HopFacet.ts | 250 ++++ typings/IHopBridge.ts | 211 +++ typings/factories/HopFacet__factory.ts | 268 ++++ typings/factories/IHopBridge__factory.ts | 114 ++ typings/index.ts | 4 + 15 files changed, 3177 insertions(+), 10 deletions(-) create mode 100644 artifacts/HopFacet.json create mode 100644 artifacts/IHopBridge.json delete mode 100644 artifacts/console.json create mode 100644 config/hop.ts create mode 100644 deploy/206_deploy_hop_facet.ts create mode 100644 src/bridges/facets/HopFacet.sol create mode 100644 src/bridges/interfaces/IHopBridge.sol create mode 100644 test/bridges/HopFacet.ts create mode 100644 typings/HopFacet.ts create mode 100644 typings/IHopBridge.ts create mode 100644 typings/factories/HopFacet__factory.ts create mode 100644 typings/factories/IHopBridge__factory.ts diff --git a/artifacts/HopFacet.json b/artifacts/HopFacet.json new file mode 100644 index 00000000..dbac4386 --- /dev/null +++ b/artifacts/HopFacet.json @@ -0,0 +1,221 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HopFacet", + "sourceName": "src/bridges/facets/HopFacet.sol", + "abi": [ + { + "inputs": [], + "name": "CannotBridgeToSameNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "NativeValueWithERC", + "type": "error" + }, + { + "inputs": [], + "name": "NoTransferToNullAddress", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddrIsNotAValidSpender", + "type": "error" + }, + { + "inputs": [], + "name": "NullAddrIsNotAnERC20Token", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyError", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "chainLayerId", + "type": "uint256" + } + ], + "name": "HopInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_destination", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_bridge", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_ammWrapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_bonderFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amountOutMin", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_destinationAmountOutMin", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_destinationDeadline", + "type": "uint256" + } + ], + "name": "HopTokenSwap", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "bridge", + "type": "address" + }, + { + "internalType": "address", + "name": "ammWrapper", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bonderFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destinationAmountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destinationDeadline", + "type": "uint256" + } + ], + "internalType": "struct HopFacet.HopData", + "name": "_hopData", + "type": "tuple" + } + ], + "name": "hopTokenTransfer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainLayerId", + "type": "uint256" + } + ], + "name": "initHop", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50611740806100206000396000f3fe6080604052600436106100295760003560e01c80635254f5a91461002e578063fbdfb9071461004a575b600080fd5b61004860048036038101906100439190610f83565b610073565b005b34801561005657600080fd5b50610071600480360381019061006c9190610fad565b610409565b005b600061007d61046a565b90506001816000015414156100be576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600181600001819055506100e88260400160208101906100de9190610f31565b8360a00135610497565b600060016100f46104d5565b14156101145782600001602081019061010d9190610f31565b905061012a565b8260200160208101906101279190610f31565b90505b82608001356101376104e8565b141561016f576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101908360400160208101906101859190610f31565b828560a001356104f5565b60006101ad8460400160208101906101a89190610f31565b610660565b6101b85760006101be565b8360a001355b905060016101ca6104d5565b1415610272578173ffffffffffffffffffffffffffffffffffffffff1663deace8f58286608001358760600160208101906102059190610f31565b8860a001358961012001358a61014001356000806040518963ffffffff1660e01b815260040161023b9796959493929190611340565b6000604051808303818588803b15801561025457600080fd5b505af1158015610268573d6000803e3d6000fd5b505050505061031e565b8173ffffffffffffffffffffffffffffffffffffffff1663eea0d7b28286608001358760600160208101906102a79190610f31565b8860a001358960c001358a60e001358b61010001358c61012001358d61014001356040518a63ffffffff1660e01b81526004016102eb9897969594939291906113af565b6000604051808303818588803b15801561030457600080fd5b505af1158015610318573d6000803e3d6000fd5b50505050505b8360400160208101906103319190610f31565b73ffffffffffffffffffffffffffffffffffffffff1684606001602081019061035a9190610f31565b73ffffffffffffffffffffffffffffffffffffffff1685608001357f35ac5f1aa56e86e7f2e01562289e5bd298773763192f6433fde30f05932381738760000160208101906103a99190610f31565b8860200160208101906103bc9190610f31565b8960a001358a60c001358b60e001358c61010001358d61012001358e61014001356040516103f19897969594939291906111d7565b60405180910390a45050600081600001819055505050565b610411610698565b600061041b610733565b90508181600001819055507f09b9d2d59be87e537ec1f2f9325f524d04c29f20e2c60ce0c3c6435102c7882a61044f6104e8565b8360405161045e92919061142d565b60405180910390a15050565b6000807fc59b5acc5a6673a6c49ca2de898f87adbd9fdfdff36f689476b1c9e0c50964b490508091505090565b6104d18282600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610760565b5050565b60006104df610733565b60000154905090565b6000804690508091505090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561052f5761065b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610596576040517f63ba9bff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016105d3929190611177565b60206040518083038186803b1580156105eb57600080fd5b505afa1580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190610fd6565b9050818110156106595761065884847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610884565b5b505b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6106a06109e2565b60040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610731576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610728906112a0565b60405180910390fd5b565b6000807f82ac262a0ca73826b2defa6066a5cbdaefe5f87d412e3568bfc9bec85eaa985790508091505090565b600082141561079b576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156107df578134146107da576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61087f565b60003414610818576040517e3f45b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061082384610a0f565b905061083184333086610adb565b828161083c86610a0f565b6108469190611488565b1461087d576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050565b600081148061091d575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016108cb929190611177565b60206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b9190610fd6565b145b61095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095390611320565b60405180910390fd5b6109dd8363095ea7b360e01b848460405160240161097b929190611255565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bbb565b505050565b6000807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90508091505090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610ad2578173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a7d919061115c565b60206040518083038186803b158015610a9557600080fd5b505afa158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190610fd6565b610ad4565b475b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610b42576040517fd1bebf0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ba9576040517f21f7434500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bb584848484610c82565b50505050565b6000610c1d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610d0b9092919063ffffffff16565b9050600081511115610c7d5780806020019051810190610c3d9190610f5a565b610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7390611300565b60405180910390fd5b5b505050565b610d05846323b872dd60e01b858585604051602401610ca3939291906111a0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bbb565b50505050565b6060610d1a8484600085610d23565b90509392505050565b606082471015610d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5f906112c0565b60405180910390fd5b610d7185610e37565b610db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da7906112e0565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610dd99190611145565b60006040518083038185875af1925050503d8060008114610e16576040519150601f19603f3d011682016040523d82523d6000602084013e610e1b565b606091505b5091509150610e2b828286610e5a565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315610e6a57829050610eba565b600083511115610e7d5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb1919061127e565b60405180910390fd5b9392505050565b600081359050610ed0816116ee565b92915050565b600081519050610ee581611705565b92915050565b60006101608284031215610efe57600080fd5b81905092915050565b600081359050610f168161171c565b92915050565b600081519050610f2b8161171c565b92915050565b600060208284031215610f4357600080fd5b6000610f5184828501610ec1565b91505092915050565b600060208284031215610f6c57600080fd5b6000610f7a84828501610ed6565b91505092915050565b60006101608284031215610f9657600080fd5b6000610fa484828501610eeb565b91505092915050565b600060208284031215610fbf57600080fd5b6000610fcd84828501610f07565b91505092915050565b600060208284031215610fe857600080fd5b6000610ff684828501610f1c565b91505092915050565b611008816114bc565b82525050565b600061101982611456565b611023818561146c565b9350611033818560208601611516565b80840191505092915050565b61104881611504565b82525050565b600061105982611461565b6110638185611477565b9350611073818560208601611516565b61107c81611578565b840191505092915050565b6000611094602283611477565b915061109f82611589565b604082019050919050565b60006110b7602683611477565b91506110c2826115d8565b604082019050919050565b60006110da601d83611477565b91506110e582611627565b602082019050919050565b60006110fd602a83611477565b915061110882611650565b604082019050919050565b6000611120603683611477565b915061112b8261169f565b604082019050919050565b61113f816114fa565b82525050565b6000611151828461100e565b915081905092915050565b60006020820190506111716000830184610fff565b92915050565b600060408201905061118c6000830185610fff565b6111996020830184610fff565b9392505050565b60006060820190506111b56000830186610fff565b6111c26020830185610fff565b6111cf6040830184611136565b949350505050565b6000610100820190506111ed600083018b610fff565b6111fa602083018a610fff565b6112076040830189611136565b6112146060830188611136565b6112216080830187611136565b61122e60a0830186611136565b61123b60c0830185611136565b61124860e0830184611136565b9998505050505050505050565b600060408201905061126a6000830185610fff565b6112776020830184611136565b9392505050565b60006020820190508181036000830152611298818461104e565b905092915050565b600060208201905081810360008301526112b981611087565b9050919050565b600060208201905081810360008301526112d9816110aa565b9050919050565b600060208201905081810360008301526112f9816110cd565b9050919050565b60006020820190508181036000830152611319816110f0565b9050919050565b6000602082019050818103600083015261133981611113565b9050919050565b600060e082019050611355600083018a611136565b6113626020830189610fff565b61136f6040830188611136565b61137c6060830187611136565b6113896080830186611136565b61139660a0830185610fff565b6113a360c083018461103f565b98975050505050505050565b6000610100820190506113c5600083018b611136565b6113d2602083018a610fff565b6113df6040830189611136565b6113ec6060830188611136565b6113f96080830187611136565b61140660a0830186611136565b61141360c0830185611136565b61142060e0830184611136565b9998505050505050505050565b60006040820190506114426000830185611136565b61144f6020830184611136565b9392505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000611493826114fa565b915061149e836114fa565b9250828210156114b1576114b0611549565b5b828203905092915050565b60006114c7826114da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061150f826114fa565b9050919050565b60005b83811015611534578082015181840152602081019050611519565b83811115611543576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b6116f7816114bc565b811461170257600080fd5b50565b61170e816114ce565b811461171957600080fd5b50565b611725816114fa565b811461173057600080fd5b5056fea164736f6c6343000804000a", + "deployedBytecode": "0x6080604052600436106100295760003560e01c80635254f5a91461002e578063fbdfb9071461004a575b600080fd5b61004860048036038101906100439190610f83565b610073565b005b34801561005657600080fd5b50610071600480360381019061006c9190610fad565b610409565b005b600061007d61046a565b90506001816000015414156100be576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600181600001819055506100e88260400160208101906100de9190610f31565b8360a00135610497565b600060016100f46104d5565b14156101145782600001602081019061010d9190610f31565b905061012a565b8260200160208101906101279190610f31565b90505b82608001356101376104e8565b141561016f576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101908360400160208101906101859190610f31565b828560a001356104f5565b60006101ad8460400160208101906101a89190610f31565b610660565b6101b85760006101be565b8360a001355b905060016101ca6104d5565b1415610272578173ffffffffffffffffffffffffffffffffffffffff1663deace8f58286608001358760600160208101906102059190610f31565b8860a001358961012001358a61014001356000806040518963ffffffff1660e01b815260040161023b9796959493929190611340565b6000604051808303818588803b15801561025457600080fd5b505af1158015610268573d6000803e3d6000fd5b505050505061031e565b8173ffffffffffffffffffffffffffffffffffffffff1663eea0d7b28286608001358760600160208101906102a79190610f31565b8860a001358960c001358a60e001358b61010001358c61012001358d61014001356040518a63ffffffff1660e01b81526004016102eb9897969594939291906113af565b6000604051808303818588803b15801561030457600080fd5b505af1158015610318573d6000803e3d6000fd5b50505050505b8360400160208101906103319190610f31565b73ffffffffffffffffffffffffffffffffffffffff1684606001602081019061035a9190610f31565b73ffffffffffffffffffffffffffffffffffffffff1685608001357f35ac5f1aa56e86e7f2e01562289e5bd298773763192f6433fde30f05932381738760000160208101906103a99190610f31565b8860200160208101906103bc9190610f31565b8960a001358a60c001358b60e001358c61010001358d61012001358e61014001356040516103f19897969594939291906111d7565b60405180910390a45050600081600001819055505050565b610411610698565b600061041b610733565b90508181600001819055507f09b9d2d59be87e537ec1f2f9325f524d04c29f20e2c60ce0c3c6435102c7882a61044f6104e8565b8360405161045e92919061142d565b60405180910390a15050565b6000807fc59b5acc5a6673a6c49ca2de898f87adbd9fdfdff36f689476b1c9e0c50964b490508091505090565b6104d18282600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610760565b5050565b60006104df610733565b60000154905090565b6000804690508091505090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561052f5761065b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610596576040517f63ba9bff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016105d3929190611177565b60206040518083038186803b1580156105eb57600080fd5b505afa1580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190610fd6565b9050818110156106595761065884847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610884565b5b505b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6106a06109e2565b60040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610731576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610728906112a0565b60405180910390fd5b565b6000807f82ac262a0ca73826b2defa6066a5cbdaefe5f87d412e3568bfc9bec85eaa985790508091505090565b600082141561079b576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156107df578134146107da576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61087f565b60003414610818576040517e3f45b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061082384610a0f565b905061083184333086610adb565b828161083c86610a0f565b6108469190611488565b1461087d576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050565b600081148061091d575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016108cb929190611177565b60206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b9190610fd6565b145b61095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095390611320565b60405180910390fd5b6109dd8363095ea7b360e01b848460405160240161097b929190611255565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bbb565b505050565b6000807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90508091505090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610ad2578173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a7d919061115c565b60206040518083038186803b158015610a9557600080fd5b505afa158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190610fd6565b610ad4565b475b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610b42576040517fd1bebf0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ba9576040517f21f7434500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bb584848484610c82565b50505050565b6000610c1d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610d0b9092919063ffffffff16565b9050600081511115610c7d5780806020019051810190610c3d9190610f5a565b610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7390611300565b60405180910390fd5b5b505050565b610d05846323b872dd60e01b858585604051602401610ca3939291906111a0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bbb565b50505050565b6060610d1a8484600085610d23565b90509392505050565b606082471015610d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5f906112c0565b60405180910390fd5b610d7185610e37565b610db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da7906112e0565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610dd99190611145565b60006040518083038185875af1925050503d8060008114610e16576040519150601f19603f3d011682016040523d82523d6000602084013e610e1b565b606091505b5091509150610e2b828286610e5a565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315610e6a57829050610eba565b600083511115610e7d5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb1919061127e565b60405180910390fd5b9392505050565b600081359050610ed0816116ee565b92915050565b600081519050610ee581611705565b92915050565b60006101608284031215610efe57600080fd5b81905092915050565b600081359050610f168161171c565b92915050565b600081519050610f2b8161171c565b92915050565b600060208284031215610f4357600080fd5b6000610f5184828501610ec1565b91505092915050565b600060208284031215610f6c57600080fd5b6000610f7a84828501610ed6565b91505092915050565b60006101608284031215610f9657600080fd5b6000610fa484828501610eeb565b91505092915050565b600060208284031215610fbf57600080fd5b6000610fcd84828501610f07565b91505092915050565b600060208284031215610fe857600080fd5b6000610ff684828501610f1c565b91505092915050565b611008816114bc565b82525050565b600061101982611456565b611023818561146c565b9350611033818560208601611516565b80840191505092915050565b61104881611504565b82525050565b600061105982611461565b6110638185611477565b9350611073818560208601611516565b61107c81611578565b840191505092915050565b6000611094602283611477565b915061109f82611589565b604082019050919050565b60006110b7602683611477565b91506110c2826115d8565b604082019050919050565b60006110da601d83611477565b91506110e582611627565b602082019050919050565b60006110fd602a83611477565b915061110882611650565b604082019050919050565b6000611120603683611477565b915061112b8261169f565b604082019050919050565b61113f816114fa565b82525050565b6000611151828461100e565b915081905092915050565b60006020820190506111716000830184610fff565b92915050565b600060408201905061118c6000830185610fff565b6111996020830184610fff565b9392505050565b60006060820190506111b56000830186610fff565b6111c26020830185610fff565b6111cf6040830184611136565b949350505050565b6000610100820190506111ed600083018b610fff565b6111fa602083018a610fff565b6112076040830189611136565b6112146060830188611136565b6112216080830187611136565b61122e60a0830186611136565b61123b60c0830185611136565b61124860e0830184611136565b9998505050505050505050565b600060408201905061126a6000830185610fff565b6112776020830184611136565b9392505050565b60006020820190508181036000830152611298818461104e565b905092915050565b600060208201905081810360008301526112b981611087565b9050919050565b600060208201905081810360008301526112d9816110aa565b9050919050565b600060208201905081810360008301526112f9816110cd565b9050919050565b60006020820190508181036000830152611319816110f0565b9050919050565b6000602082019050818103600083015261133981611113565b9050919050565b600060e082019050611355600083018a611136565b6113626020830189610fff565b61136f6040830188611136565b61137c6060830187611136565b6113896080830186611136565b61139660a0830185610fff565b6113a360c083018461103f565b98975050505050505050565b6000610100820190506113c5600083018b611136565b6113d2602083018a610fff565b6113df6040830189611136565b6113ec6060830188611136565b6113f96080830187611136565b61140660a0830186611136565b61141360c0830185611136565b61142060e0830184611136565b9998505050505050505050565b60006040820190506114426000830185611136565b61144f6020830184611136565b9392505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000611493826114fa565b915061149e836114fa565b9250828210156114b1576114b0611549565b5b828203905092915050565b60006114c7826114da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061150f826114fa565b9050919050565b60005b83811015611534578082015181840152602081019050611519565b83811115611543576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b6116f7816114bc565b811461170257600080fd5b50565b61170e816114ce565b811461171957600080fd5b50565b611725816114fa565b811461173057600080fd5b5056fea164736f6c6343000804000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/artifacts/IHopBridge.json b/artifacts/IHopBridge.json new file mode 100644 index 00000000..dfdf6a22 --- /dev/null +++ b/artifacts/IHopBridge.json @@ -0,0 +1,102 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "IHopBridge", + "sourceName": "src/bridges/interfaces/IHopBridge.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "relayerFee", + "type": "uint256" + } + ], + "name": "sendToL2", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bonderFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destinationAmountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "destinationDeadline", + "type": "uint256" + } + ], + "name": "swapAndSend", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/artifacts/console.json b/artifacts/console.json deleted file mode 100644 index a2c0bb3a..00000000 --- a/artifacts/console.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "console", - "sourceName": "hardhat/console.sol", - "abi": [], - "bytecode": "0x602d6050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c634300080b000a", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea164736f6c634300080b000a", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/config/hop.ts b/config/hop.ts new file mode 100644 index 00000000..009002a3 --- /dev/null +++ b/config/hop.ts @@ -0,0 +1,26 @@ +import { NetworkNames } from "../extensions/constants"; + +const L1 = [ + NetworkNames.Rinkeby, + NetworkNames.Goerli, + NetworkNames.Kovan, +] + +const L2 = [ + NetworkNames.Xdai, + NetworkNames.Optimism, + NetworkNames.Arbitrum, + NetworkNames.Matic, + NetworkNames.Mumbai, +] + +export const HopConfig = Object.values(NetworkNames).reduce((obj, name) => { + if (L1.some(n => n === name)) { + obj[name] = 1; + } else if (L2.some(n => n === name)) { + obj[name] = 2; + } + return obj; +}, {}); + +HopConfig['hardhat'] = 1; // for testing purposes diff --git a/deploy/206_deploy_hop_facet.ts b/deploy/206_deploy_hop_facet.ts new file mode 100644 index 00000000..d04cb7cd --- /dev/null +++ b/deploy/206_deploy_hop_facet.ts @@ -0,0 +1,47 @@ +import { DeployFunction } from 'hardhat-deploy/types'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import { addOrReplaceFacets } from '../utils/diamond'; +import { HopConfig } from '../config/hop'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { + deployments: { deploy }, + getNamedAccounts, + ethers, + network + } = hre; + const { from } = await getNamedAccounts(); + + if (!HopConfig[network.name]) { + throw new Error("No config for this network available: " + network.name); + } + + await deploy('HopFacet', { + from, + log: true, + }); + + const diamond = await ethers.getContract('Diamond'); + const hopFacet = await ethers.getContract("HopFacet"); + + const ABI = ['function initHop(uint256)']; + const iface = new hre.ethers.utils.Interface(ABI) + + console.log('HopConfig', HopConfig[network.name]); + + const initData = iface.encodeFunctionData('initHop', [ + HopConfig[network.name] + ]); + + await addOrReplaceFacets( + [hopFacet], + diamond.address, + hopFacet.address, + initData + ); +} + +func.tags = ['bridges', 'hop']; +func.dependencies = ['init-facets']; + +export default func; diff --git a/extensions/utils.ts b/extensions/utils.ts index 39f3b788..2b0acc79 100644 --- a/extensions/utils.ts +++ b/extensions/utils.ts @@ -1,5 +1,7 @@ import { HardhatUserConfig } from 'hardhat/config'; import { NetworkNames, NETWORK_CONFIGS } from './constants'; +import * as dotenv from 'dotenv'; +dotenv.config(); export function createConfigNetwork( networkName: NetworkNames, diff --git a/package-lock.json b/package-lock.json index bc5efb67..99c0165c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1404,6 +1404,81 @@ "@ethersproject/transactions": "^5.6.2" } }, + "node_modules/@ethersproject/hardware-wallets": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hardware-wallets/-/hardware-wallets-5.6.1.tgz", + "integrity": "sha512-9BnZiEhCsDhbjrP46Zqe979iZBXW07zy29e5WTjiuew1vpl2Defq3s5Tu8Vc2fThz7Ibcwn/CrAKQlBevkxF1w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ledgerhq/hw-app-eth": "5.27.2", + "@ledgerhq/hw-transport": "5.26.0", + "@ledgerhq/hw-transport-u2f": "5.26.0", + "ethers": "^5.6.8" + }, + "optionalDependencies": { + "@ledgerhq/hw-transport-node-hid": "5.26.0" + } + }, + "node_modules/@ethersproject/hardware-wallets/node_modules/ethers": { + "version": "5.6.9", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.9.tgz", + "integrity": "sha512-lMGC2zv9HC5EC+8r429WaWu3uWJUCgUCt8xxKCFqkrFuBDZXDYIdzDUECxzjf2BMF8IVBByY1EBoGSL3RTm8RA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abi": "5.6.4", + "@ethersproject/abstract-provider": "5.6.1", + "@ethersproject/abstract-signer": "5.6.2", + "@ethersproject/address": "5.6.1", + "@ethersproject/base64": "5.6.1", + "@ethersproject/basex": "5.6.1", + "@ethersproject/bignumber": "5.6.2", + "@ethersproject/bytes": "5.6.1", + "@ethersproject/constants": "5.6.1", + "@ethersproject/contracts": "5.6.2", + "@ethersproject/hash": "5.6.1", + "@ethersproject/hdnode": "5.6.2", + "@ethersproject/json-wallets": "5.6.1", + "@ethersproject/keccak256": "5.6.1", + "@ethersproject/logger": "5.6.0", + "@ethersproject/networks": "5.6.4", + "@ethersproject/pbkdf2": "5.6.1", + "@ethersproject/properties": "5.6.0", + "@ethersproject/providers": "5.6.8", + "@ethersproject/random": "5.6.1", + "@ethersproject/rlp": "5.6.1", + "@ethersproject/sha2": "5.6.1", + "@ethersproject/signing-key": "5.6.2", + "@ethersproject/solidity": "5.6.1", + "@ethersproject/strings": "5.6.1", + "@ethersproject/transactions": "5.6.2", + "@ethersproject/units": "5.6.1", + "@ethersproject/wallet": "5.6.2", + "@ethersproject/web": "5.6.1", + "@ethersproject/wordlists": "5.6.1" + } + }, "node_modules/@ethersproject/hash": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", @@ -1928,6 +2003,227 @@ "node": ">= 10.14.2" } }, + "node_modules/@ledgerhq/cryptoassets": { + "version": "5.53.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-5.53.0.tgz", + "integrity": "sha512-M3ibc3LRuHid5UtL7FI3IC6nMEppvly98QHFoSa7lJU0HDzQxY6zHec/SPM4uuJUC8sXoGVAiRJDkgny54damw==", + "dev": true, + "peer": true, + "dependencies": { + "invariant": "2" + } + }, + "node_modules/@ledgerhq/devices": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.51.1.tgz", + "integrity": "sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA==", + "dev": true, + "peer": true, + "dependencies": { + "@ledgerhq/errors": "^5.50.0", + "@ledgerhq/logs": "^5.50.0", + "rxjs": "6", + "semver": "^7.3.5" + } + }, + "node_modules/@ledgerhq/errors": { + "version": "5.50.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.50.0.tgz", + "integrity": "sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow==", + "dev": true, + "peer": true + }, + "node_modules/@ledgerhq/hw-app-eth": { + "version": "5.27.2", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-5.27.2.tgz", + "integrity": "sha512-llNdrE894cCN8j6yxJEUniciyLVcLmu5N0UmIJLOObztG+5rOF4bX54h4SreTWK+E10Z0CzHSeyE5Lz/tVcqqQ==", + "dev": true, + "peer": true, + "dependencies": { + "@ledgerhq/cryptoassets": "^5.27.2", + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "bignumber.js": "^9.0.1", + "rlp": "^2.2.6" + } + }, + "node_modules/@ledgerhq/hw-transport": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.26.0.tgz", + "integrity": "sha512-NFeJOJmyEfAX8uuIBTpocWHcz630sqPcXbu864Q+OCBm4EK5UOKV1h/pX7e0xgNIKY8zhJ/O4p4cIZp9tnXLHQ==", + "dev": true, + "peer": true, + "dependencies": { + "@ledgerhq/devices": "^5.26.0", + "@ledgerhq/errors": "^5.26.0", + "events": "^3.2.0" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-5.26.0.tgz", + "integrity": "sha512-qhaefZVZatJ6UuK8Wb6WSFNOLWc2mxcv/xgsfKi5HJCIr4bPF/ecIeN+7fRcEaycxj4XykY6Z4A7zDVulfFH4w==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@ledgerhq/devices": "^5.26.0", + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "@ledgerhq/hw-transport-node-hid-noevents": "^5.26.0", + "@ledgerhq/logs": "^5.26.0", + "lodash": "^4.17.20", + "node-hid": "1.3.0", + "usb": "^1.6.3" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.51.1.tgz", + "integrity": "sha512-9wFf1L8ZQplF7XOY2sQGEeOhpmBRzrn+4X43kghZ7FBDoltrcK+s/D7S+7ffg3j2OySyP6vIIIgloXylao5Scg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@ledgerhq/devices": "^5.51.1", + "@ledgerhq/errors": "^5.50.0", + "@ledgerhq/hw-transport": "^5.51.1", + "@ledgerhq/logs": "^5.50.0", + "node-hid": "2.1.1" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/@ledgerhq/hw-transport": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz", + "integrity": "sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@ledgerhq/devices": "^5.51.1", + "@ledgerhq/errors": "^5.50.0", + "events": "^3.3.0" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/node-hid": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.1.1.tgz", + "integrity": "sha512-Skzhqow7hyLZU93eIPthM9yjot9lszg9xrKxESleEs05V2NcbUptZc5HFqzjOkSmL0sFlZFr3kmvaYebx06wrw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^3.0.2", + "prebuild-install": "^6.0.0" + }, + "bin": { + "hid-showdevices": "src/show-devices.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/prebuild-install": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.21.0", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@ledgerhq/hw-transport-node-hid-noevents/node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/@ledgerhq/hw-transport-u2f": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-5.26.0.tgz", + "integrity": "sha512-QTxP1Rsh+WZ184LUOelYVLeaQl3++V3I2jFik+l9JZtakwEHjD0XqOT750xpYNL/vfHsy31Wlz+oicdxGzFk+w==", + "deprecated": "@ledgerhq/hw-transport-u2f is deprecated. Please use @ledgerhq/hw-transport-webusb or @ledgerhq/hw-transport-webhid. https://github.com/LedgerHQ/ledgerjs/blob/master/docs/migrate_webusb.md", + "dev": true, + "peer": true, + "dependencies": { + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "@ledgerhq/logs": "^5.26.0", + "u2f-api": "0.2.7" + } + }, + "node_modules/@ledgerhq/logs": { + "version": "5.50.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.50.0.tgz", + "integrity": "sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA==", + "dev": true, + "peer": true + }, "node_modules/@metamask/eth-sig-util": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", @@ -2033,6 +2329,17 @@ "integrity": "sha512-h1j0af7qZfc5Q0XGUW1EZYph3paBG8YmkyJEa3BJH64tmZ0yZ4qjWSOa2IMNfI7d0h2/+mCcUCTyTwfHfSZpFg==", "dev": true }, + "node_modules/@nomiclabs/hardhat-ethers": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.1.0.tgz", + "integrity": "sha512-vlW90etB3675QWG7tMrHaDoTa7ymMB7irM4DAQ98g8zJoe9YqEggeDnbO6v5b+BLth/ty4vN6Ko/kaqRN1krHw==", + "dev": true, + "peer": true, + "peerDependencies": { + "ethers": "^5.0.0", + "hardhat": "^2.0.0" + } + }, "node_modules/@nomiclabs/hardhat-etherscan": { "version": "2.1.7", "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.7.tgz", @@ -4479,6 +4786,62 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/are-we-there-yet/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/are-we-there-yet/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -4876,6 +5239,45 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "peer": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/blakejs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", @@ -6062,6 +6464,14 @@ "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", "dev": true }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/constant-case": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz", @@ -6592,6 +7002,14 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -6645,6 +7063,20 @@ "node": ">=4" } }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/detect-port": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", @@ -9361,6 +9793,17 @@ "safe-buffer": "^5.1.1" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/expect": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", @@ -9832,6 +10275,14 @@ "node": ">= 0.6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/fs-extra": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", @@ -10980,6 +11431,79 @@ "decamelize": "^1.2.0" } }, + "node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/gauge/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gauge/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gauge/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gauge/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/get-assigned-identifiers": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", @@ -11157,6 +11681,14 @@ "node": ">=4" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -12530,6 +13062,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -13001,6 +13541,16 @@ "node": ">= 0.10" } }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -14123,6 +14673,19 @@ "node": ">=4" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/loupe": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", @@ -14951,6 +15514,14 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/nats": { "version": "1.4.12", "resolved": "https://registry.npmjs.org/nats/-/nats-1.4.12.tgz", @@ -15043,6 +15614,28 @@ "lower-case": "^1.1.1" } }, + "node_modules/node-abi": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", + "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "semver": "^5.4.1" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", @@ -15108,6 +15701,27 @@ "node-gyp-build-test": "build-test.js" } }, + "node_modules/node-hid": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-1.3.0.tgz", + "integrity": "sha512-BA6G4V84kiNd1uAChub/Z/5s/xS3EHBCxotQ0nyYrUG65mXewUDHE1tWOSqA2dp3N+mV0Ffq9wo2AW9t4p/G7g==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.14.0", + "node-abi": "^2.18.0", + "prebuild-install": "^5.3.4" + }, + "bin": { + "hid-showdevices": "src/show-devices.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/node-nats-streaming": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/node-nats-streaming/-/node-nats-streaming-0.2.6.tgz", @@ -15131,6 +15745,14 @@ "node": ">=12.19" } }, + "node_modules/noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha512-6kM8CLXvuW5crTxsAtva2YLrRrDaiTIkIePWs9moLHqbFWT94WpNFjwS/5dfLfECg5i/lkmw3aoqVidxt23TEQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -15182,6 +15804,20 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -15834,6 +16470,78 @@ "integrity": "sha512-mMMOwSKrmyl+Y12Ri2xhH1lbzQxwwpuru9VjyJpgFIH4asSj88F2csdMwN6+M5g1Ll4rmsYghHLQJw81tgZ7LQ==", "dev": true }, + "node_modules/prebuild-install": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", + "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/prebuild-install/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/prebuild-install/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prebuild-install/node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -16125,6 +16833,34 @@ "node": ">= 0.8" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -19231,6 +19967,38 @@ "node": ">=4.5" } }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tar/node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -20029,6 +20797,13 @@ "node": ">=8" } }, + "node_modules/u2f-api": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/u2f-api/-/u2f-api-0.2.7.tgz", + "integrity": "sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==", + "dev": true, + "peer": true + }, "node_modules/uglify-js": { "version": "3.16.1", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.1.tgz", @@ -20182,6 +20957,30 @@ "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", "dev": true }, + "node_modules/usb": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/usb/-/usb-1.9.2.tgz", + "integrity": "sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "node-addon-api": "^4.2.0", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/usb/node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/utf-8-validate": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", @@ -21440,6 +22239,17 @@ "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/which-typed-array": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", @@ -22843,6 +23653,61 @@ "@ethersproject/transactions": "^5.6.2" } }, + "@ethersproject/hardware-wallets": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hardware-wallets/-/hardware-wallets-5.6.1.tgz", + "integrity": "sha512-9BnZiEhCsDhbjrP46Zqe979iZBXW07zy29e5WTjiuew1vpl2Defq3s5Tu8Vc2fThz7Ibcwn/CrAKQlBevkxF1w==", + "dev": true, + "peer": true, + "requires": { + "@ledgerhq/hw-app-eth": "5.27.2", + "@ledgerhq/hw-transport": "5.26.0", + "@ledgerhq/hw-transport-node-hid": "5.26.0", + "@ledgerhq/hw-transport-u2f": "5.26.0", + "ethers": "^5.6.8" + }, + "dependencies": { + "ethers": { + "version": "5.6.9", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.9.tgz", + "integrity": "sha512-lMGC2zv9HC5EC+8r429WaWu3uWJUCgUCt8xxKCFqkrFuBDZXDYIdzDUECxzjf2BMF8IVBByY1EBoGSL3RTm8RA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abi": "5.6.4", + "@ethersproject/abstract-provider": "5.6.1", + "@ethersproject/abstract-signer": "5.6.2", + "@ethersproject/address": "5.6.1", + "@ethersproject/base64": "5.6.1", + "@ethersproject/basex": "5.6.1", + "@ethersproject/bignumber": "5.6.2", + "@ethersproject/bytes": "5.6.1", + "@ethersproject/constants": "5.6.1", + "@ethersproject/contracts": "5.6.2", + "@ethersproject/hash": "5.6.1", + "@ethersproject/hdnode": "5.6.2", + "@ethersproject/json-wallets": "5.6.1", + "@ethersproject/keccak256": "5.6.1", + "@ethersproject/logger": "5.6.0", + "@ethersproject/networks": "5.6.4", + "@ethersproject/pbkdf2": "5.6.1", + "@ethersproject/properties": "5.6.0", + "@ethersproject/providers": "5.6.8", + "@ethersproject/random": "5.6.1", + "@ethersproject/rlp": "5.6.1", + "@ethersproject/sha2": "5.6.1", + "@ethersproject/signing-key": "5.6.2", + "@ethersproject/solidity": "5.6.1", + "@ethersproject/strings": "5.6.1", + "@ethersproject/transactions": "5.6.2", + "@ethersproject/units": "5.6.1", + "@ethersproject/wallet": "5.6.2", + "@ethersproject/web": "5.6.1", + "@ethersproject/wordlists": "5.6.1" + } + } + } + }, "@ethersproject/hash": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", @@ -23165,6 +24030,206 @@ "chalk": "^4.0.0" } }, + "@ledgerhq/cryptoassets": { + "version": "5.53.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-5.53.0.tgz", + "integrity": "sha512-M3ibc3LRuHid5UtL7FI3IC6nMEppvly98QHFoSa7lJU0HDzQxY6zHec/SPM4uuJUC8sXoGVAiRJDkgny54damw==", + "dev": true, + "peer": true, + "requires": { + "invariant": "2" + } + }, + "@ledgerhq/devices": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/devices/-/devices-5.51.1.tgz", + "integrity": "sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA==", + "dev": true, + "peer": true, + "requires": { + "@ledgerhq/errors": "^5.50.0", + "@ledgerhq/logs": "^5.50.0", + "rxjs": "6", + "semver": "^7.3.5" + } + }, + "@ledgerhq/errors": { + "version": "5.50.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/errors/-/errors-5.50.0.tgz", + "integrity": "sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow==", + "dev": true, + "peer": true + }, + "@ledgerhq/hw-app-eth": { + "version": "5.27.2", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-5.27.2.tgz", + "integrity": "sha512-llNdrE894cCN8j6yxJEUniciyLVcLmu5N0UmIJLOObztG+5rOF4bX54h4SreTWK+E10Z0CzHSeyE5Lz/tVcqqQ==", + "dev": true, + "peer": true, + "requires": { + "@ledgerhq/cryptoassets": "^5.27.2", + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "bignumber.js": "^9.0.1", + "rlp": "^2.2.6" + } + }, + "@ledgerhq/hw-transport": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.26.0.tgz", + "integrity": "sha512-NFeJOJmyEfAX8uuIBTpocWHcz630sqPcXbu864Q+OCBm4EK5UOKV1h/pX7e0xgNIKY8zhJ/O4p4cIZp9tnXLHQ==", + "dev": true, + "peer": true, + "requires": { + "@ledgerhq/devices": "^5.26.0", + "@ledgerhq/errors": "^5.26.0", + "events": "^3.2.0" + } + }, + "@ledgerhq/hw-transport-node-hid": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-5.26.0.tgz", + "integrity": "sha512-qhaefZVZatJ6UuK8Wb6WSFNOLWc2mxcv/xgsfKi5HJCIr4bPF/ecIeN+7fRcEaycxj4XykY6Z4A7zDVulfFH4w==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "@ledgerhq/devices": "^5.26.0", + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "@ledgerhq/hw-transport-node-hid-noevents": "^5.26.0", + "@ledgerhq/logs": "^5.26.0", + "lodash": "^4.17.20", + "node-hid": "1.3.0", + "usb": "^1.6.3" + } + }, + "@ledgerhq/hw-transport-node-hid-noevents": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-node-hid-noevents/-/hw-transport-node-hid-noevents-5.51.1.tgz", + "integrity": "sha512-9wFf1L8ZQplF7XOY2sQGEeOhpmBRzrn+4X43kghZ7FBDoltrcK+s/D7S+7ffg3j2OySyP6vIIIgloXylao5Scg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "@ledgerhq/devices": "^5.51.1", + "@ledgerhq/errors": "^5.50.0", + "@ledgerhq/hw-transport": "^5.51.1", + "@ledgerhq/logs": "^5.50.0", + "node-hid": "2.1.1" + }, + "dependencies": { + "@ledgerhq/hw-transport": { + "version": "5.51.1", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz", + "integrity": "sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "@ledgerhq/devices": "^5.51.1", + "@ledgerhq/errors": "^5.50.0", + "events": "^3.3.0" + } + }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "optional": true, + "peer": true + }, + "node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true, + "optional": true, + "peer": true + }, + "node-hid": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-2.1.1.tgz", + "integrity": "sha512-Skzhqow7hyLZU93eIPthM9yjot9lszg9xrKxESleEs05V2NcbUptZc5HFqzjOkSmL0sFlZFr3kmvaYebx06wrw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "bindings": "^1.5.0", + "node-addon-api": "^3.0.2", + "prebuild-install": "^6.0.0" + } + }, + "prebuild-install": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.21.0", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + } + }, + "simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + } + } + }, + "@ledgerhq/hw-transport-u2f": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-5.26.0.tgz", + "integrity": "sha512-QTxP1Rsh+WZ184LUOelYVLeaQl3++V3I2jFik+l9JZtakwEHjD0XqOT750xpYNL/vfHsy31Wlz+oicdxGzFk+w==", + "dev": true, + "peer": true, + "requires": { + "@ledgerhq/errors": "^5.26.0", + "@ledgerhq/hw-transport": "^5.26.0", + "@ledgerhq/logs": "^5.26.0", + "u2f-api": "0.2.7" + } + }, + "@ledgerhq/logs": { + "version": "5.50.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-5.50.0.tgz", + "integrity": "sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA==", + "dev": true, + "peer": true + }, "@metamask/eth-sig-util": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", @@ -23248,6 +24313,14 @@ "integrity": "sha512-h1j0af7qZfc5Q0XGUW1EZYph3paBG8YmkyJEa3BJH64tmZ0yZ4qjWSOa2IMNfI7d0h2/+mCcUCTyTwfHfSZpFg==", "dev": true }, + "@nomiclabs/hardhat-ethers": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.1.0.tgz", + "integrity": "sha512-vlW90etB3675QWG7tMrHaDoTa7ymMB7irM4DAQ98g8zJoe9YqEggeDnbO6v5b+BLth/ty4vN6Ko/kaqRN1krHw==", + "dev": true, + "peer": true, + "requires": {} + }, "@nomiclabs/hardhat-etherscan": { "version": "2.1.7", "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-2.1.7.tgz", @@ -25268,6 +26341,64 @@ "picomatch": "^2.0.4" } }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "optional": true, + "peer": true + }, + "are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true, + "peer": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -25582,6 +26713,33 @@ "safe-buffer": "^5.0.1" } }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + } + } + }, "blakejs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", @@ -26584,6 +27742,14 @@ "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", "dev": true }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true, + "optional": true, + "peer": true + }, "constant-case": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz", @@ -27004,6 +28170,14 @@ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true, + "optional": true, + "peer": true + }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -27044,6 +28218,14 @@ "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", "dev": true }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "optional": true, + "peer": true + }, "detect-port": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", @@ -29092,6 +30274,14 @@ "safe-buffer": "^5.1.1" } }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "optional": true, + "peer": true + }, "expect": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", @@ -29475,6 +30665,14 @@ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "optional": true, + "peer": true + }, "fs-extra": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", @@ -30328,6 +31526,69 @@ } } }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "optional": true, + "peer": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, "get-assigned-identifiers": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", @@ -30465,6 +31726,14 @@ } } }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "optional": true, + "peer": true + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -31507,6 +32776,14 @@ "has-symbols": "^1.0.2" } }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true, + "optional": true, + "peer": true + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -31894,6 +33171,16 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "peer": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -32758,6 +34045,16 @@ } } }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, "loupe": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", @@ -33425,6 +34722,14 @@ "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, + "napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "dev": true, + "optional": true, + "peer": true + }, "nats": { "version": "1.4.12", "resolved": "https://registry.npmjs.org/nats/-/nats-1.4.12.tgz", @@ -33507,6 +34812,27 @@ "lower-case": "^1.1.1" } }, + "node-abi": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", + "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "semver": "^5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", @@ -33555,6 +34881,20 @@ "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", "dev": true }, + "node-hid": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/node-hid/-/node-hid-1.3.0.tgz", + "integrity": "sha512-BA6G4V84kiNd1uAChub/Z/5s/xS3EHBCxotQ0nyYrUG65mXewUDHE1tWOSqA2dp3N+mV0Ffq9wo2AW9t4p/G7g==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.14.0", + "node-abi": "^2.18.0", + "prebuild-install": "^5.3.4" + } + }, "node-nats-streaming": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/node-nats-streaming/-/node-nats-streaming-0.2.6.tgz", @@ -33572,6 +34912,14 @@ "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", "dev": true }, + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha512-6kM8CLXvuW5crTxsAtva2YLrRrDaiTIkIePWs9moLHqbFWT94WpNFjwS/5dfLfECg5i/lkmw3aoqVidxt23TEQ==", + "dev": true, + "optional": true, + "peer": true + }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -33613,6 +34961,20 @@ "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, "nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -34121,6 +35483,65 @@ "integrity": "sha512-mMMOwSKrmyl+Y12Ri2xhH1lbzQxwwpuru9VjyJpgFIH4asSj88F2csdMwN6+M5g1Ll4rmsYghHLQJw81tgZ7LQ==", "dev": true }, + "prebuild-install": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", + "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "mimic-response": "^2.0.0" + } + }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "optional": true, + "peer": true + }, + "simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + } + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -34345,6 +35766,30 @@ "unpipe": "1.0.0" } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -36856,6 +38301,35 @@ } } }, + "tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + }, "test-value": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", @@ -37493,6 +38967,13 @@ "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", "dev": true }, + "u2f-api": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/u2f-api/-/u2f-api-0.2.7.tgz", + "integrity": "sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==", + "dev": true, + "peer": true + }, "uglify-js": { "version": "3.16.1", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.1.tgz", @@ -37618,6 +39099,28 @@ "integrity": "sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==", "dev": true }, + "usb": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/usb/-/usb-1.9.2.tgz", + "integrity": "sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "node-addon-api": "^4.2.0", + "node-gyp-build": "^4.3.0" + }, + "dependencies": { + "node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "utf-8-validate": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.9.tgz", @@ -38715,6 +40218,14 @@ "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, + "which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "dev": true, + "optional": true, + "peer": true + }, "which-typed-array": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", diff --git a/src/bridges/facets/HopFacet.sol b/src/bridges/facets/HopFacet.sol new file mode 100644 index 00000000..2305e46a --- /dev/null +++ b/src/bridges/facets/HopFacet.sol @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.4; + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { IHopBridge } from "../interfaces/IHopBridge.sol"; +import { LibAsset } from "../libs/LibAsset.sol"; +import { LibDiamond } from "../libs/LibDiamond.sol"; +import { ReentrancyGuard } from "../../common/helpers/DiamondReentrancyGuard.sol"; +import { + InvalidAmount, + InvalidBridgeConfigLength, + CannotBridgeToSameNetwork, + NativeValueWithERC, + InvalidConfig +} from "../errors/GenericErrors.sol"; + +/** + * @title Hop Protocol Integration + * + * @notice Contract which provides bridging functionality through Hop Protocol + * + */ +contract HopFacet is ReentrancyGuard { + // storage + + bytes32 internal constant NAMESPACE = keccak256("io.etherspot.facets.hop"); + struct Storage { + uint256 chainLayerId; + } + + // types + + struct HopData { + address bridge; + address ammWrapper; + address asset; + address recipient; + uint256 chainId; + uint256 amount; + uint256 bonderFee; + uint256 amountOutMin; + uint256 deadline; + uint256 destinationAmountOutMin; + uint256 destinationDeadline; + } + + // events + + /** + * @dev Emitted when facet initializes + * @param chainId current chain id + * @param chainLayerId current chain layer id + */ + event HopInitialized( + uint256 chainId, + uint256 chainLayerId + ); + + /** + * @dev Emitted on token swap + * @param _destination destination chain id + * @param _bridge address of the bridge on chain _destination, + * @param _ammWrapper address of the amm wrapper, + * @param _recipient recipient + * @param _asset address of the asset + * @param _amount amount of assets + * @param _bonderFee fee + * @param _amountOutMin The minimum amount received after attempting to + * swap in the destination + * @param _deadline The deadline for swapping in the destination AMM market. + * 0 if no * swap is intended. + * @param _destinationAmountOutMin The minimum amount of tokens to receive after bridging + * @param _destinationDeadline The time the transaction must be completed + */ + event HopTokenSwap( + uint256 indexed _destination, + address _bridge, + address _ammWrapper, + address indexed _recipient, + address indexed _asset, + uint256 _amount, + uint256 _bonderFee, + uint256 _amountOutMin, + uint256 _deadline, + uint256 _destinationAmountOutMin, + uint256 _destinationDeadline + ); + + + + // external functions + + /** + * @notice Initializes local variables for the Connext facet + */ + function initHop(uint256 _chainLayerId) external { + LibDiamond.enforceIsContractOwner(); + + Storage storage s = getStorage(); + s.chainLayerId = _chainLayerId; + + emit HopInitialized( + getChainID(), + _chainLayerId + ); + } + + /** + * @notice Bridges tokens via Hop Protocol + * @param _hopData data specific to Hop Protocol + */ + function hopTokenTransfer( + HopData calldata _hopData + ) external payable nonReentrant { + LibAsset.depositAsset(_hopData.asset, _hopData.amount); + + address bridge; + if (getLayerId() == 1) { + bridge = _hopData.bridge; + } else { + bridge = _hopData.ammWrapper; + } + + if (getChainID() == _hopData.chainId) + revert CannotBridgeToSameNetwork(); + + // Give Hop approval to bridge tokens + LibAsset.maxApproveERC20( + IERC20(_hopData.asset), + bridge, + _hopData.amount + ); + + uint256 value = LibAsset.isNativeAsset(_hopData.asset) + ? _hopData.amount + : 0; + + if (getLayerId() == 1) { + // Ethereum L1 + IHopBridge(bridge).sendToL2{value: value}( + _hopData.chainId, + _hopData.recipient, + _hopData.amount, + _hopData.destinationAmountOutMin, + _hopData.destinationDeadline, + address(0), + 0 + ); + } else { + // L2 + IHopBridge(bridge).swapAndSend{value: value}( + _hopData.chainId, + _hopData.recipient, + _hopData.amount, + _hopData.bonderFee, + _hopData.amountOutMin, + _hopData.deadline, + _hopData.destinationAmountOutMin, + _hopData.destinationDeadline + ); + } + emit HopTokenSwap( + _hopData.chainId, + _hopData.bridge, + _hopData.ammWrapper, + _hopData.recipient, + _hopData.asset, + _hopData.amount, + _hopData.bonderFee, + _hopData.amountOutMin, + _hopData.deadline, + _hopData.destinationAmountOutMin, + _hopData.destinationDeadline + ); + } + + /// private Methods /// + + /** + * @dev returns local storage + */ + function getStorage() private pure returns (Storage storage s) { + bytes32 namespace = NAMESPACE; + // solhint-disable-next-line no-inline-assembly + assembly { + s.slot := namespace + } + } + + /** + * @dev returns current chain layer number + * @return uint256 layer number + */ + function getLayerId() private view returns (uint256) { + return getStorage().chainLayerId; + } + + /** + * @dev fetch chain id + */ + function getChainID() private view returns (uint256) { + uint256 id; + // solhint-disable-next-line no-inline-assembly + assembly { + id := chainid() + } + return id; + } +} diff --git a/src/bridges/interfaces/IHopBridge.sol b/src/bridges/interfaces/IHopBridge.sol new file mode 100644 index 00000000..9f20c8ac --- /dev/null +++ b/src/bridges/interfaces/IHopBridge.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.4; + +interface IHopBridge { + function sendToL2( + uint256 chainId, + address recipient, + uint256 amount, + uint256 amountOutMin, + uint256 deadline, + address relayer, + uint256 relayerFee + ) external payable; + + function swapAndSend( + uint256 chainId, + address recipient, + uint256 amount, + uint256 bonderFee, + uint256 amountOutMin, + uint256 deadline, + uint256 destinationAmountOutMin, + uint256 destinationDeadline + ) external payable; +} diff --git a/test/bridges/HopFacet.ts b/test/bridges/HopFacet.ts new file mode 100644 index 00000000..8adca4e4 --- /dev/null +++ b/test/bridges/HopFacet.ts @@ -0,0 +1,187 @@ + +import { ethers, network, deployments, config } from 'hardhat'; +import { Diamond, HopFacet, IERC20 } from '../../typings'; +import { + processTx, + randomAddress, + SignerWithAddress, +} from '../shared'; +import { HopConfig } from '../../config/hop'; + +describe.only('HopFacet', () => { + describe("L1->L2", () => { + const TEST_TOKEN_ADDRESS = '0x98339D8C260052B7ad81c28c16C0b98420f2B46a'; + const SIGNER_ADDRESS = '0x03db1fa14c9d67a426d1d03514901fff08dc87cf'; + let signer: SignerWithAddress; + let hopFacet: HopFacet; + let token: IERC20; + let diamond: Diamond; + + before(async function () { + const networkConfig: any = config.networks['goerli']; + await network.provider.request({ + method: 'hardhat_reset', + params: [ + { + forking: { + jsonRpcUrl: networkConfig.url, + blockNumber: 7345346, + }, + }, + ], + }); + await network.provider.request({ + method: 'hardhat_impersonateAccount', + params: [SIGNER_ADDRESS], // has lots of test tokens and some ether + }); + signer = await ethers.getSigner( + SIGNER_ADDRESS + ); + await network.provider.send('hardhat_setBalance', [ + SIGNER_ADDRESS, + ethers.utils.parseEther('1000.0').toHexString(), + ]); + token = (await ethers.getContractAt('IERC20', TEST_TOKEN_ADDRESS)).connect(signer); + + await deployments.fixture(['hop']); + diamond = await ethers.getContract('Diamond'); + hopFacet = ( + await ethers.getContractAt( + 'HopFacet', + diamond.address + ) + ).connect(signer); + }); + + it('performs erc20 token swap', async () => { + await token.approve( + diamond.address, + ethers.constants.MaxUint256 + ); + const recipient = randomAddress(); + const amount = ethers.utils.parseEther('10'); + const { events } = await processTx( + hopFacet.hopTokenTransfer( + { + bridge: '0x39B052820F808534d5eD7C2b26f070169Fa6A686', + ammWrapper: ethers.constants.AddressZero, + asset: TEST_TOKEN_ADDRESS, + recipient: recipient, + chainId: 80001, + amount: amount, + bonderFee: 0, + amountOutMin: 0, + deadline: 0, + destinationAmountOutMin: 0, + destinationDeadline: 0, + } + ) + ); + + const event = events.find(({ event }) => event === 'HopTokenSwap'); + expect(event).toBeDefined(); + expect(event.args._destination).toEqual(ethers.BigNumber.from(80001)); + expect(event.args._bridge).toEqual('0x39B052820F808534d5eD7C2b26f070169Fa6A686'); + expect(event.args._ammWrapper).toEqual(ethers.constants.AddressZero); + expect(event.args._recipient).toEqual(recipient); + expect(event.args._asset).toEqual(TEST_TOKEN_ADDRESS); + expect(event.args._amount).toEqual(amount); + expect(event.args._bonderFee).toEqual(ethers.BigNumber.from(0)); + expect(event.args._amountOutMin).toEqual(ethers.BigNumber.from(0)); + expect(event.args._deadline).toEqual(ethers.BigNumber.from(0)); + expect(event.args._destinationAmountOutMin).toEqual(ethers.BigNumber.from(0)); + expect(event.args._destinationDeadline).toEqual(ethers.BigNumber.from(0)); + }); + }); + + describe('L2->L2, L2->L1', () => { + const TEST_TOKEN_ADDRESS = '0x6D4dd09982853F08d9966aC3cA4Eb5885F16f2b2'; + const SIGNER_ADDRESS = '0x02b260F6f47FF328496Be632678d06a564B8c4AB'; + let signer: SignerWithAddress; + let hopFacet: HopFacet; + let token: IERC20; + let diamond: Diamond; + + before(async function () { + HopConfig['hardhat'] = 2; + const networkConfig: any = config.networks['mumbai']; + await network.provider.request({ + method: 'hardhat_reset', + params: [ + { + forking: { + jsonRpcUrl: networkConfig.url, + blockNumber: 27472016, + }, + }, + ], + }); + await network.provider.request({ + method: 'hardhat_impersonateAccount', + params: [SIGNER_ADDRESS], // has lots of test tokens and some ether + }); + signer = await ethers.getSigner( + SIGNER_ADDRESS + ); + await network.provider.send('hardhat_setBalance', [ + SIGNER_ADDRESS, + ethers.utils.parseEther('1000.0').toHexString(), + ]); + token = (await ethers.getContractAt('IERC20', TEST_TOKEN_ADDRESS)).connect(signer); + + await deployments.fixture(['hop']); + diamond = await ethers.getContract('Diamond'); + hopFacet = ( + await ethers.getContractAt( + 'HopFacet', + diamond.address + ) + ).connect(signer); + }); + + it('performs erc20 token swap', async () => { + await token.approve( + diamond.address, + ethers.constants.MaxUint256 + ); + const recipient = randomAddress(); + const amount = ethers.utils.parseEther('10'); + const { events } = await processTx( + hopFacet.hopTokenTransfer( + { + bridge: ethers.constants.AddressZero, + ammWrapper: '0xa228A81FA5d3525b7637ADF66FA35794451bBa7c', + asset: TEST_TOKEN_ADDRESS, + recipient: recipient, + chainId: 80001, + amount: amount, + bonderFee: 0, + amountOutMin: 0, + deadline: 0, + destinationAmountOutMin: 0, + destinationDeadline: 0, + } + ) + ); + + console.log(events); + const event = events.find(({ event }) => event === 'HopTokenSwap'); + expect(event).toBeDefined(); + expect(event.args._destination).toEqual(ethers.BigNumber.from(80001)); + expect(event.args._bridge).toEqual(ethers.constants.AddressZero); + expect(event.args._ammWrapper).toEqual('0xa228A81FA5d3525b7637ADF66FA35794451bBa7c'); + expect(event.args._recipient).toEqual(recipient); + expect(event.args._asset).toEqual(TEST_TOKEN_ADDRESS); + expect(event.args._amount).toEqual(amount); + expect(event.args._bonderFee).toEqual(ethers.BigNumber.from(0)); + expect(event.args._amountOutMin).toEqual(ethers.BigNumber.from(0)); + expect(event.args._deadline).toEqual(ethers.BigNumber.from(0)); + expect(event.args._destinationAmountOutMin).toEqual(ethers.BigNumber.from(0)); + expect(event.args._destinationDeadline).toEqual(ethers.BigNumber.from(0)); + }); + + after(() => { + HopConfig['hardhat'] = 1; + }) + }); +}); diff --git a/typings/HopFacet.ts b/typings/HopFacet.ts new file mode 100644 index 00000000..2287fe21 --- /dev/null +++ b/typings/HopFacet.ts @@ -0,0 +1,250 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import { FunctionFragment, Result, EventFragment } from "@ethersproject/abi"; +import { Listener, Provider } from "@ethersproject/providers"; +import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; + +export type HopDataStruct = { + bridge: string; + ammWrapper: string; + asset: string; + recipient: string; + chainId: BigNumberish; + amount: BigNumberish; + bonderFee: BigNumberish; + amountOutMin: BigNumberish; + deadline: BigNumberish; + destinationAmountOutMin: BigNumberish; + destinationDeadline: BigNumberish; +}; + +export type HopDataStructOutput = [ + string, + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber +] & { + bridge: string; + ammWrapper: string; + asset: string; + recipient: string; + chainId: BigNumber; + amount: BigNumber; + bonderFee: BigNumber; + amountOutMin: BigNumber; + deadline: BigNumber; + destinationAmountOutMin: BigNumber; + destinationDeadline: BigNumber; +}; + +export interface HopFacetInterface extends utils.Interface { + functions: { + "hopTokenTransfer((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,uint256))": FunctionFragment; + "initHop(uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "hopTokenTransfer", + values: [HopDataStruct] + ): string; + encodeFunctionData( + functionFragment: "initHop", + values: [BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "hopTokenTransfer", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initHop", data: BytesLike): Result; + + events: { + "HopInitialized(uint256,uint256)": EventFragment; + "HopTokenSwap(uint256,address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "HopInitialized"): EventFragment; + getEvent(nameOrSignatureOrTopic: "HopTokenSwap"): EventFragment; +} + +export type HopInitializedEvent = TypedEvent< + [BigNumber, BigNumber], + { chainId: BigNumber; chainLayerId: BigNumber } +>; + +export type HopInitializedEventFilter = TypedEventFilter; + +export type HopTokenSwapEvent = TypedEvent< + [ + BigNumber, + string, + string, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], + { + _destination: BigNumber; + _bridge: string; + _ammWrapper: string; + _recipient: string; + _asset: string; + _amount: BigNumber; + _bonderFee: BigNumber; + _amountOutMin: BigNumber; + _deadline: BigNumber; + _destinationAmountOutMin: BigNumber; + _destinationDeadline: BigNumber; + } +>; + +export type HopTokenSwapEventFilter = TypedEventFilter; + +export interface HopFacet extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: HopFacetInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + hopTokenTransfer( + _hopData: HopDataStruct, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + initHop( + _chainLayerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + hopTokenTransfer( + _hopData: HopDataStruct, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + initHop( + _chainLayerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + + callStatic: { + hopTokenTransfer( + _hopData: HopDataStruct, + overrides?: CallOverrides + ): Promise; + + initHop( + _chainLayerId: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "HopInitialized(uint256,uint256)"( + chainId?: null, + chainLayerId?: null + ): HopInitializedEventFilter; + HopInitialized( + chainId?: null, + chainLayerId?: null + ): HopInitializedEventFilter; + + "HopTokenSwap(uint256,address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256)"( + _destination?: BigNumberish | null, + _bridge?: null, + _ammWrapper?: null, + _recipient?: string | null, + _asset?: string | null, + _amount?: null, + _bonderFee?: null, + _amountOutMin?: null, + _deadline?: null, + _destinationAmountOutMin?: null, + _destinationDeadline?: null + ): HopTokenSwapEventFilter; + HopTokenSwap( + _destination?: BigNumberish | null, + _bridge?: null, + _ammWrapper?: null, + _recipient?: string | null, + _asset?: string | null, + _amount?: null, + _bonderFee?: null, + _amountOutMin?: null, + _deadline?: null, + _destinationAmountOutMin?: null, + _destinationDeadline?: null + ): HopTokenSwapEventFilter; + }; + + estimateGas: { + hopTokenTransfer( + _hopData: HopDataStruct, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + initHop( + _chainLayerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + hopTokenTransfer( + _hopData: HopDataStruct, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + initHop( + _chainLayerId: BigNumberish, + overrides?: Overrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/typings/IHopBridge.ts b/typings/IHopBridge.ts new file mode 100644 index 00000000..f3a12bcf --- /dev/null +++ b/typings/IHopBridge.ts @@ -0,0 +1,211 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import { FunctionFragment, Result } from "@ethersproject/abi"; +import { Listener, Provider } from "@ethersproject/providers"; +import { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common"; + +export interface IHopBridgeInterface extends utils.Interface { + functions: { + "sendToL2(uint256,address,uint256,uint256,uint256,address,uint256)": FunctionFragment; + "swapAndSend(uint256,address,uint256,uint256,uint256,uint256,uint256,uint256)": FunctionFragment; + }; + + encodeFunctionData( + functionFragment: "sendToL2", + values: [ + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + string, + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "swapAndSend", + values: [ + BigNumberish, + string, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish + ] + ): string; + + decodeFunctionResult(functionFragment: "sendToL2", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "swapAndSend", + data: BytesLike + ): Result; + + events: {}; +} + +export interface IHopBridge extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: IHopBridgeInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + sendToL2( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + relayer: string, + relayerFee: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + swapAndSend( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + bonderFee: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + destinationAmountOutMin: BigNumberish, + destinationDeadline: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + }; + + sendToL2( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + relayer: string, + relayerFee: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + swapAndSend( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + bonderFee: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + destinationAmountOutMin: BigNumberish, + destinationDeadline: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + callStatic: { + sendToL2( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + relayer: string, + relayerFee: BigNumberish, + overrides?: CallOverrides + ): Promise; + + swapAndSend( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + bonderFee: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + destinationAmountOutMin: BigNumberish, + destinationDeadline: BigNumberish, + overrides?: CallOverrides + ): Promise; + }; + + filters: {}; + + estimateGas: { + sendToL2( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + relayer: string, + relayerFee: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + swapAndSend( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + bonderFee: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + destinationAmountOutMin: BigNumberish, + destinationDeadline: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + }; + + populateTransaction: { + sendToL2( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + relayer: string, + relayerFee: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + + swapAndSend( + chainId: BigNumberish, + recipient: string, + amount: BigNumberish, + bonderFee: BigNumberish, + amountOutMin: BigNumberish, + deadline: BigNumberish, + destinationAmountOutMin: BigNumberish, + destinationDeadline: BigNumberish, + overrides?: PayableOverrides & { from?: string | Promise } + ): Promise; + }; +} diff --git a/typings/factories/HopFacet__factory.ts b/typings/factories/HopFacet__factory.ts new file mode 100644 index 00000000..1ed5b908 --- /dev/null +++ b/typings/factories/HopFacet__factory.ts @@ -0,0 +1,268 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; +import { Provider, TransactionRequest } from "@ethersproject/providers"; +import type { HopFacet, HopFacetInterface } from "../HopFacet"; + +const _abi = [ + { + inputs: [], + name: "CannotBridgeToSameNetwork", + type: "error", + }, + { + inputs: [], + name: "InvalidAmount", + type: "error", + }, + { + inputs: [], + name: "NativeValueWithERC", + type: "error", + }, + { + inputs: [], + name: "NoTransferToNullAddress", + type: "error", + }, + { + inputs: [], + name: "NullAddrIsNotAValidSpender", + type: "error", + }, + { + inputs: [], + name: "NullAddrIsNotAnERC20Token", + type: "error", + }, + { + inputs: [], + name: "ReentrancyError", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "chainLayerId", + type: "uint256", + }, + ], + name: "HopInitialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "_destination", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "_bridge", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "_ammWrapper", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_recipient", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "_asset", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "_bonderFee", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "_amountOutMin", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "_deadline", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "_destinationAmountOutMin", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "_destinationDeadline", + type: "uint256", + }, + ], + name: "HopTokenSwap", + type: "event", + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "bridge", + type: "address", + }, + { + internalType: "address", + name: "ammWrapper", + type: "address", + }, + { + internalType: "address", + name: "asset", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "bonderFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint256", + name: "destinationAmountOutMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "destinationDeadline", + type: "uint256", + }, + ], + internalType: "struct HopFacet.HopData", + name: "_hopData", + type: "tuple", + }, + ], + name: "hopTokenTransfer", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_chainLayerId", + type: "uint256", + }, + ], + name: "initHop", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +const _bytecode = + "0x608060405234801561001057600080fd5b50611740806100206000396000f3fe6080604052600436106100295760003560e01c80635254f5a91461002e578063fbdfb9071461004a575b600080fd5b61004860048036038101906100439190610f83565b610073565b005b34801561005657600080fd5b50610071600480360381019061006c9190610fad565b610409565b005b600061007d61046a565b90506001816000015414156100be576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600181600001819055506100e88260400160208101906100de9190610f31565b8360a00135610497565b600060016100f46104d5565b14156101145782600001602081019061010d9190610f31565b905061012a565b8260200160208101906101279190610f31565b90505b82608001356101376104e8565b141561016f576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101908360400160208101906101859190610f31565b828560a001356104f5565b60006101ad8460400160208101906101a89190610f31565b610660565b6101b85760006101be565b8360a001355b905060016101ca6104d5565b1415610272578173ffffffffffffffffffffffffffffffffffffffff1663deace8f58286608001358760600160208101906102059190610f31565b8860a001358961012001358a61014001356000806040518963ffffffff1660e01b815260040161023b9796959493929190611340565b6000604051808303818588803b15801561025457600080fd5b505af1158015610268573d6000803e3d6000fd5b505050505061031e565b8173ffffffffffffffffffffffffffffffffffffffff1663eea0d7b28286608001358760600160208101906102a79190610f31565b8860a001358960c001358a60e001358b61010001358c61012001358d61014001356040518a63ffffffff1660e01b81526004016102eb9897969594939291906113af565b6000604051808303818588803b15801561030457600080fd5b505af1158015610318573d6000803e3d6000fd5b50505050505b8360400160208101906103319190610f31565b73ffffffffffffffffffffffffffffffffffffffff1684606001602081019061035a9190610f31565b73ffffffffffffffffffffffffffffffffffffffff1685608001357f35ac5f1aa56e86e7f2e01562289e5bd298773763192f6433fde30f05932381738760000160208101906103a99190610f31565b8860200160208101906103bc9190610f31565b8960a001358a60c001358b60e001358c61010001358d61012001358e61014001356040516103f19897969594939291906111d7565b60405180910390a45050600081600001819055505050565b610411610698565b600061041b610733565b90508181600001819055507f09b9d2d59be87e537ec1f2f9325f524d04c29f20e2c60ce0c3c6435102c7882a61044f6104e8565b8360405161045e92919061142d565b60405180910390a15050565b6000807fc59b5acc5a6673a6c49ca2de898f87adbd9fdfdff36f689476b1c9e0c50964b490508091505090565b6104d18282600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610760565b5050565b60006104df610733565b60000154905090565b6000804690508091505090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561052f5761065b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610596576040517f63ba9bff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016105d3929190611177565b60206040518083038186803b1580156105eb57600080fd5b505afa1580156105ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106239190610fd6565b9050818110156106595761065884847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610884565b5b505b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6106a06109e2565b60040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610731576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610728906112a0565b60405180910390fd5b565b6000807f82ac262a0ca73826b2defa6066a5cbdaefe5f87d412e3568bfc9bec85eaa985790508091505090565b600082141561079b576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156107df578134146107da576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61087f565b60003414610818576040517e3f45b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061082384610a0f565b905061083184333086610adb565b828161083c86610a0f565b6108469190611488565b1461087d576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b505050565b600081148061091d575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016108cb929190611177565b60206040518083038186803b1580156108e357600080fd5b505afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b9190610fd6565b145b61095c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095390611320565b60405180910390fd5b6109dd8363095ea7b360e01b848460405160240161097b929190611255565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bbb565b505050565b6000807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90508091505090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610ad2578173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a7d919061115c565b60206040518083038186803b158015610a9557600080fd5b505afa158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190610fd6565b610ad4565b475b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610b42576040517fd1bebf0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ba9576040517f21f7434500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bb584848484610c82565b50505050565b6000610c1d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610d0b9092919063ffffffff16565b9050600081511115610c7d5780806020019051810190610c3d9190610f5a565b610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7390611300565b60405180910390fd5b5b505050565b610d05846323b872dd60e01b858585604051602401610ca3939291906111a0565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bbb565b50505050565b6060610d1a8484600085610d23565b90509392505050565b606082471015610d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5f906112c0565b60405180910390fd5b610d7185610e37565b610db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da7906112e0565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610dd99190611145565b60006040518083038185875af1925050503d8060008114610e16576040519150601f19603f3d011682016040523d82523d6000602084013e610e1b565b606091505b5091509150610e2b828286610e5a565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315610e6a57829050610eba565b600083511115610e7d5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb1919061127e565b60405180910390fd5b9392505050565b600081359050610ed0816116ee565b92915050565b600081519050610ee581611705565b92915050565b60006101608284031215610efe57600080fd5b81905092915050565b600081359050610f168161171c565b92915050565b600081519050610f2b8161171c565b92915050565b600060208284031215610f4357600080fd5b6000610f5184828501610ec1565b91505092915050565b600060208284031215610f6c57600080fd5b6000610f7a84828501610ed6565b91505092915050565b60006101608284031215610f9657600080fd5b6000610fa484828501610eeb565b91505092915050565b600060208284031215610fbf57600080fd5b6000610fcd84828501610f07565b91505092915050565b600060208284031215610fe857600080fd5b6000610ff684828501610f1c565b91505092915050565b611008816114bc565b82525050565b600061101982611456565b611023818561146c565b9350611033818560208601611516565b80840191505092915050565b61104881611504565b82525050565b600061105982611461565b6110638185611477565b9350611073818560208601611516565b61107c81611578565b840191505092915050565b6000611094602283611477565b915061109f82611589565b604082019050919050565b60006110b7602683611477565b91506110c2826115d8565b604082019050919050565b60006110da601d83611477565b91506110e582611627565b602082019050919050565b60006110fd602a83611477565b915061110882611650565b604082019050919050565b6000611120603683611477565b915061112b8261169f565b604082019050919050565b61113f816114fa565b82525050565b6000611151828461100e565b915081905092915050565b60006020820190506111716000830184610fff565b92915050565b600060408201905061118c6000830185610fff565b6111996020830184610fff565b9392505050565b60006060820190506111b56000830186610fff565b6111c26020830185610fff565b6111cf6040830184611136565b949350505050565b6000610100820190506111ed600083018b610fff565b6111fa602083018a610fff565b6112076040830189611136565b6112146060830188611136565b6112216080830187611136565b61122e60a0830186611136565b61123b60c0830185611136565b61124860e0830184611136565b9998505050505050505050565b600060408201905061126a6000830185610fff565b6112776020830184611136565b9392505050565b60006020820190508181036000830152611298818461104e565b905092915050565b600060208201905081810360008301526112b981611087565b9050919050565b600060208201905081810360008301526112d9816110aa565b9050919050565b600060208201905081810360008301526112f9816110cd565b9050919050565b60006020820190508181036000830152611319816110f0565b9050919050565b6000602082019050818103600083015261133981611113565b9050919050565b600060e082019050611355600083018a611136565b6113626020830189610fff565b61136f6040830188611136565b61137c6060830187611136565b6113896080830186611136565b61139660a0830185610fff565b6113a360c083018461103f565b98975050505050505050565b6000610100820190506113c5600083018b611136565b6113d2602083018a610fff565b6113df6040830189611136565b6113ec6060830188611136565b6113f96080830187611136565b61140660a0830186611136565b61141360c0830185611136565b61142060e0830184611136565b9998505050505050505050565b60006040820190506114426000830185611136565b61144f6020830184611136565b9392505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000611493826114fa565b915061149e836114fa565b9250828210156114b1576114b0611549565b5b828203905092915050565b60006114c7826114da565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061150f826114fa565b9050919050565b60005b83811015611534578082015181840152602081019050611519565b83811115611543576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b6116f7816114bc565b811461170257600080fd5b50565b61170e816114ce565b811461171957600080fd5b50565b611725816114fa565b811461173057600080fd5b5056fea164736f6c6343000804000a"; + +type HopFacetConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: HopFacetConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class HopFacet__factory extends ContractFactory { + constructor(...args: HopFacetConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + deploy( + overrides?: Overrides & { from?: string | Promise } + ): Promise { + return super.deploy(overrides || {}) as Promise; + } + getDeployTransaction( + overrides?: Overrides & { from?: string | Promise } + ): TransactionRequest { + return super.getDeployTransaction(overrides || {}); + } + attach(address: string): HopFacet { + return super.attach(address) as HopFacet; + } + connect(signer: Signer): HopFacet__factory { + return super.connect(signer) as HopFacet__factory; + } + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): HopFacetInterface { + return new utils.Interface(_abi) as HopFacetInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): HopFacet { + return new Contract(address, _abi, signerOrProvider) as HopFacet; + } +} diff --git a/typings/factories/IHopBridge__factory.ts b/typings/factories/IHopBridge__factory.ts new file mode 100644 index 00000000..6ff9a2cd --- /dev/null +++ b/typings/factories/IHopBridge__factory.ts @@ -0,0 +1,114 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import { Provider } from "@ethersproject/providers"; +import type { IHopBridge, IHopBridgeInterface } from "../IHopBridge"; + +const _abi = [ + { + inputs: [ + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "address", + name: "relayer", + type: "address", + }, + { + internalType: "uint256", + name: "relayerFee", + type: "uint256", + }, + ], + name: "sendToL2", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "chainId", + type: "uint256", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "bonderFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountOutMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint256", + name: "destinationAmountOutMin", + type: "uint256", + }, + { + internalType: "uint256", + name: "destinationDeadline", + type: "uint256", + }, + ], + name: "swapAndSend", + outputs: [], + stateMutability: "payable", + type: "function", + }, +]; + +export class IHopBridge__factory { + static readonly abi = _abi; + static createInterface(): IHopBridgeInterface { + return new utils.Interface(_abi) as IHopBridgeInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): IHopBridge { + return new Contract(address, _abi, signerOrProvider) as IHopBridge; + } +} diff --git a/typings/index.ts b/typings/index.ts index fa8a7da3..71139ebb 100644 --- a/typings/index.ts +++ b/typings/index.ts @@ -47,11 +47,13 @@ export type { Diamond } from "./Diamond"; export type { ConnextFacet } from "./ConnextFacet"; export type { DiamondCutFacet } from "./DiamondCutFacet"; export type { DiamondLoupeFacet } from "./DiamondLoupeFacet"; +export type { HopFacet } from "./HopFacet"; export type { OwnershipFacet } from "./OwnershipFacet"; export type { StargateFacet } from "./StargateFacet"; export type { IDiamondLoupe } from "./IDiamondLoupe"; export type { IERC165 } from "./IERC165"; export type { IERC173 } from "./IERC173"; +export type { IHopBridge } from "./IHopBridge"; export type { IStargateReceiver } from "./IStargateReceiver"; export type { IStargateRouter } from "./IStargateRouter"; export type { LibDiamond } from "./LibDiamond"; @@ -135,11 +137,13 @@ export { Diamond__factory } from "./factories/Diamond__factory"; export { ConnextFacet__factory } from "./factories/ConnextFacet__factory"; export { DiamondCutFacet__factory } from "./factories/DiamondCutFacet__factory"; export { DiamondLoupeFacet__factory } from "./factories/DiamondLoupeFacet__factory"; +export { HopFacet__factory } from "./factories/HopFacet__factory"; export { OwnershipFacet__factory } from "./factories/OwnershipFacet__factory"; export { StargateFacet__factory } from "./factories/StargateFacet__factory"; export { IDiamondLoupe__factory } from "./factories/IDiamondLoupe__factory"; export { IERC165__factory } from "./factories/IERC165__factory"; export { IERC173__factory } from "./factories/IERC173__factory"; +export { IHopBridge__factory } from "./factories/IHopBridge__factory"; export { IStargateReceiver__factory } from "./factories/IStargateReceiver__factory"; export { IStargateRouter__factory } from "./factories/IStargateRouter__factory"; export { LibDiamond__factory } from "./factories/LibDiamond__factory";