@orbs-network/twap 1.7.7 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "Taker",
|
|
4
|
+
"sourceName": "contracts/periphery/Taker.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "contract TWAP",
|
|
10
|
+
"name": "_twap",
|
|
11
|
+
"type": "address"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address[]",
|
|
15
|
+
"name": "_owners",
|
|
16
|
+
"type": "address[]"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"inputs": [
|
|
24
|
+
{
|
|
25
|
+
"internalType": "uint64",
|
|
26
|
+
"name": "id",
|
|
27
|
+
"type": "uint64"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"internalType": "address",
|
|
31
|
+
"name": "exchange",
|
|
32
|
+
"type": "address"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"internalType": "uint256",
|
|
36
|
+
"name": "dstFee",
|
|
37
|
+
"type": "uint256"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"internalType": "uint32",
|
|
41
|
+
"name": "slippagePercent",
|
|
42
|
+
"type": "uint32"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"internalType": "bytes",
|
|
46
|
+
"name": "data",
|
|
47
|
+
"type": "bytes"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"name": "bid",
|
|
51
|
+
"outputs": [],
|
|
52
|
+
"stateMutability": "nonpayable",
|
|
53
|
+
"type": "function"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"inputs": [
|
|
57
|
+
{
|
|
58
|
+
"internalType": "uint64",
|
|
59
|
+
"name": "id",
|
|
60
|
+
"type": "uint64"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"internalType": "address",
|
|
64
|
+
"name": "feeExchange",
|
|
65
|
+
"type": "address"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"internalType": "uint256",
|
|
69
|
+
"name": "feeMinAmountOut",
|
|
70
|
+
"type": "uint256"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"internalType": "bytes",
|
|
74
|
+
"name": "feeData",
|
|
75
|
+
"type": "bytes"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "fill",
|
|
79
|
+
"outputs": [],
|
|
80
|
+
"stateMutability": "nonpayable",
|
|
81
|
+
"type": "function"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"inputs": [
|
|
85
|
+
{
|
|
86
|
+
"internalType": "address",
|
|
87
|
+
"name": "",
|
|
88
|
+
"type": "address"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"name": "owners",
|
|
92
|
+
"outputs": [
|
|
93
|
+
{
|
|
94
|
+
"internalType": "bool",
|
|
95
|
+
"name": "",
|
|
96
|
+
"type": "bool"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"stateMutability": "view",
|
|
100
|
+
"type": "function"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"inputs": [
|
|
104
|
+
{
|
|
105
|
+
"internalType": "address",
|
|
106
|
+
"name": "token",
|
|
107
|
+
"type": "address"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"name": "rescue",
|
|
111
|
+
"outputs": [],
|
|
112
|
+
"stateMutability": "nonpayable",
|
|
113
|
+
"type": "function"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"inputs": [],
|
|
117
|
+
"name": "twap",
|
|
118
|
+
"outputs": [
|
|
119
|
+
{
|
|
120
|
+
"internalType": "contract TWAP",
|
|
121
|
+
"name": "",
|
|
122
|
+
"type": "address"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"stateMutability": "view",
|
|
126
|
+
"type": "function"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"stateMutability": "payable",
|
|
130
|
+
"type": "receive"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"bytecode": "0x60a06040523480156200001157600080fd5b506040516200179e3803806200179e8339810160408190526200003491620000f9565b6001600160a01b03821660805260005b8151811015620000af576001600080848481518110620000685762000068620001e4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580620000a681620001fa565b91505062000044565b50505062000222565b6001600160a01b0381168114620000ce57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620000f481620000b8565b919050565b600080604083850312156200010d57600080fd5b82516200011a81620000b8565b602084810151919350906001600160401b03808211156200013a57600080fd5b818601915086601f8301126200014f57600080fd5b815181811115620001645762000164620000d1565b8060051b604051601f19603f830116810181811085821117156200018c576200018c620000d1565b604052918252848201925083810185019189831115620001ab57600080fd5b938501935b82851015620001d457620001c485620000e7565b84529385019392850192620001b0565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b6000600182016200021b57634e487b7160e01b600052601160045260246000fd5b5060010190565b608051611529620002756000396000818160b1015281816101a401528181610229015281816102a501528181610424015281816105490152818161063b015281816106cb015261096301526115296000f3fe60806040526004361061004e5760003560e01c8063022914a71461005a5780631208aa181461009f5780631a07dd1c146100eb578063839006f21461010d578063f58e65b81461012d57600080fd5b3661005557005b600080fd5b34801561006657600080fd5b5061008a610075366004610e8c565b60006020819052908152604090205460ff1681565b60405190151581526020015b60405180910390f35b3480156100ab57600080fd5b506100d37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610096565b3480156100f757600080fd5b5061010b610106366004610f0f565b61014d565b005b34801561011957600080fd5b5061010b610128366004610e8c565b610516565b34801561013957600080fd5b5061010b610148366004610f94565b61091d565b3360009081526020819052604090205460ff166101855760405162461bcd60e51b815260040161017c90611019565b60405180910390fd5b604051630a5d165160e31b815267ffffffffffffffff861660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906352e8b28890602401600060405180830381600087803b1580156101f057600080fd5b505af1158015610204573d6000803e3d6000fd5b505060405163a0b94e0b60e01b815267ffffffffffffffff88166004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063a0b94e0b90602401600060405180830381865afa158015610279573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102a191908101906112af565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610301573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103259190611371565b6001600160a01b0316816080015160e001516001600160a01b03161415801561035e5750608081015160e001516001600160a01b031615155b801561037257506001600160a01b03851615155b156104fd57608081015160e001516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ea919061138e565b608083015160e0015190915061040a906001600160a01b031687836109dc565b856001600160a01b0316632506c018836080015160e001517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190611371565b848989896040518763ffffffff1660e01b81526004016104c9969594939291906113d0565b600060405180830381600087803b1580156104e357600080fd5b505af11580156104f7573d6000803e3d6000fd5b50505050505b61050e816080015160e00151610516565b505050505050565b3360009081526020819052604090205460ff166105455760405162461bcd60e51b815260040161017c90611019565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c99190611371565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561060f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610633919061138e565b1115610806577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610697573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bb9190611371565b6001600160a01b0316632e1a7d4d7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190611371565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b5919061138e565b6040518263ffffffff1660e01b81526004016107d391815260200190565b600060405180830381600087803b1580156107ed57600080fd5b505af1158015610801573d6000803e3d6000fd5b505050505b4715610816576108163347610ac7565b6001600160a01b0381161580159061089657506040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610870573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610894919061138e565b115b1561091a576040516370a0823160e01b815230600482015261091a9033906001600160a01b038416906370a0823190602401602060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061138e565b6001600160a01b0384169190610be5565b50565b3360009081526020819052604090205460ff1661094c5760405162461bcd60e51b815260040161017c90611019565b604051631eb1ccb760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f58e65b8906109a290899089908990899089908990600401611417565b600060405180830381600087803b1580156109bc57600080fd5b505af11580156109d0573d6000803e3d6000fd5b50505050505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a51919061138e565b610a5b919061145b565b6040516001600160a01b038516602482015260448101829052909150610ac190859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610c15565b50505050565b80471015610b175760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161017c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b64576040519150601f19603f3d011682016040523d82523d6000602084013e610b69565b606091505b5050905080610be05760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161017c565b505050565b6040516001600160a01b038316602482015260448101829052610be090849063a9059cbb60e01b90606401610a8a565b6000610c6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ce79092919063ffffffff16565b805190915015610be05780806020019051810190610c889190611482565b610be05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161017c565b6060610cf68484600085610cfe565b949350505050565b606082471015610d5f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161017c565b600080866001600160a01b03168587604051610d7b91906114a4565b60006040518083038185875af1925050503d8060008114610db8576040519150601f19603f3d011682016040523d82523d6000602084013e610dbd565b606091505b5091509150610dce87838387610dd9565b979650505050505050565b60608315610e48578251600003610e41576001600160a01b0385163b610e415760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161017c565b5081610cf6565b610cf68383815115610e5d5781518083602001fd5b8060405162461bcd60e51b815260040161017c91906114c0565b6001600160a01b038116811461091a57600080fd5b600060208284031215610e9e57600080fd5b8135610ea981610e77565b9392505050565b67ffffffffffffffff8116811461091a57600080fd5b60008083601f840112610ed857600080fd5b50813567ffffffffffffffff811115610ef057600080fd5b602083019150836020828501011115610f0857600080fd5b9250929050565b600080600080600060808688031215610f2757600080fd5b8535610f3281610eb0565b94506020860135610f4281610e77565b935060408601359250606086013567ffffffffffffffff811115610f6557600080fd5b610f7188828901610ec6565b969995985093965092949392505050565b63ffffffff8116811461091a57600080fd5b60008060008060008060a08789031215610fad57600080fd5b8635610fb881610eb0565b95506020870135610fc881610e77565b9450604087013593506060870135610fdf81610f82565b9250608087013567ffffffffffffffff811115610ffb57600080fd5b61100789828a01610ec6565b979a9699509497509295939492505050565b6020808252600a90820152696f6e6c794f776e65727360b01b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b604051610160810167ffffffffffffffff811182821017156110775761107761103d565b60405290565b60405160c0810167ffffffffffffffff811182821017156110775761107761103d565b80516110ab81610f82565b919050565b80516110ab81610e77565b600061016082840312156110ce57600080fd5b6110d6611053565b90506110e1826110a0565b81526110ef602083016110a0565b6020820152611100604083016110a0565b6040820152611111606083016110a0565b6060820152611122608083016110b0565b608082015261113360a083016110b0565b60a082015261114460c083016110b0565b60c082015261115560e083016110b0565b60e0820152610100828101519082015261012080830151908201526101409182015191810191909152919050565b60005b8381101561119e578181015183820152602001611186565b50506000910152565b600060c082840312156111b957600080fd5b6111c161107d565b905081516111ce81610f82565b815260208201516111de81610e77565b602082015260408201516111f181610e77565b80604083015250606082015160608201526080820151608082015260a082015167ffffffffffffffff8082111561122757600080fd5b818401915084601f83011261123b57600080fd5b81518181111561124d5761124d61103d565b604051601f8201601f19908116603f011681019083821181831017156112755761127561103d565b8160405282815287602084870101111561128e57600080fd5b61129f836020830160208801611183565b60a0860152509295945050505050565b6000602082840312156112c157600080fd5b815167ffffffffffffffff808211156112d957600080fd5b9083019061020082860312156112ee57600080fd5b6112f661107d565b825161130181610eb0565b8152602083015161131181610f82565b6020820152611322604084016110a0565b60408201526060830151606082015261133e86608085016110bb565b60808201526101e08301518281111561135657600080fd5b611362878286016111a7565b60a08301525095945050505050565b60006020828403121561138357600080fd5b8151610ea981610e77565b6000602082840312156113a057600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905260009061140b90830184866113a7565b98975050505050505050565b67ffffffffffffffff8716815260018060a01b038616602082015284604082015263ffffffff8416606082015260a06080820152600061140b60a0830184866113a7565b8082018082111561147c57634e487b7160e01b600052601160045260246000fd5b92915050565b60006020828403121561149457600080fd5b81518015158114610ea957600080fd5b600082516114b6818460208701611183565b9190910192915050565b60208152600082518060208401526114df816040850160208701611183565b601f01601f1916919091016040019291505056fea2646970667358221220ad155ec9c6e3df240c8f4e315e5a39d2f975bd602598f4d9ff6b9f1ec313a63264736f6c63430008100033",
|
|
134
|
+
"deployedBytecode": "0x60806040526004361061004e5760003560e01c8063022914a71461005a5780631208aa181461009f5780631a07dd1c146100eb578063839006f21461010d578063f58e65b81461012d57600080fd5b3661005557005b600080fd5b34801561006657600080fd5b5061008a610075366004610e8c565b60006020819052908152604090205460ff1681565b60405190151581526020015b60405180910390f35b3480156100ab57600080fd5b506100d37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610096565b3480156100f757600080fd5b5061010b610106366004610f0f565b61014d565b005b34801561011957600080fd5b5061010b610128366004610e8c565b610516565b34801561013957600080fd5b5061010b610148366004610f94565b61091d565b3360009081526020819052604090205460ff166101855760405162461bcd60e51b815260040161017c90611019565b60405180910390fd5b604051630a5d165160e31b815267ffffffffffffffff861660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906352e8b28890602401600060405180830381600087803b1580156101f057600080fd5b505af1158015610204573d6000803e3d6000fd5b505060405163a0b94e0b60e01b815267ffffffffffffffff88166004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063a0b94e0b90602401600060405180830381865afa158015610279573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102a191908101906112af565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610301573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103259190611371565b6001600160a01b0316816080015160e001516001600160a01b03161415801561035e5750608081015160e001516001600160a01b031615155b801561037257506001600160a01b03851615155b156104fd57608081015160e001516040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ea919061138e565b608083015160e0015190915061040a906001600160a01b031687836109dc565b856001600160a01b0316632506c018836080015160e001517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190611371565b848989896040518763ffffffff1660e01b81526004016104c9969594939291906113d0565b600060405180830381600087803b1580156104e357600080fd5b505af11580156104f7573d6000803e3d6000fd5b50505050505b61050e816080015160e00151610516565b505050505050565b3360009081526020819052604090205460ff166105455760405162461bcd60e51b815260040161017c90611019565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c99190611371565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561060f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610633919061138e565b1115610806577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610697573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bb9190611371565b6001600160a01b0316632e1a7d4d7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c11a463d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190611371565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b5919061138e565b6040518263ffffffff1660e01b81526004016107d391815260200190565b600060405180830381600087803b1580156107ed57600080fd5b505af1158015610801573d6000803e3d6000fd5b505050505b4715610816576108163347610ac7565b6001600160a01b0381161580159061089657506040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610870573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610894919061138e565b115b1561091a576040516370a0823160e01b815230600482015261091a9033906001600160a01b038416906370a0823190602401602060405180830381865afa1580156108e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610909919061138e565b6001600160a01b0384169190610be5565b50565b3360009081526020819052604090205460ff1661094c5760405162461bcd60e51b815260040161017c90611019565b604051631eb1ccb760e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f58e65b8906109a290899089908990899089908990600401611417565b600060405180830381600087803b1580156109bc57600080fd5b505af11580156109d0573d6000803e3d6000fd5b50505050505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a51919061138e565b610a5b919061145b565b6040516001600160a01b038516602482015260448101829052909150610ac190859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610c15565b50505050565b80471015610b175760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161017c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610b64576040519150601f19603f3d011682016040523d82523d6000602084013e610b69565b606091505b5050905080610be05760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161017c565b505050565b6040516001600160a01b038316602482015260448101829052610be090849063a9059cbb60e01b90606401610a8a565b6000610c6a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ce79092919063ffffffff16565b805190915015610be05780806020019051810190610c889190611482565b610be05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161017c565b6060610cf68484600085610cfe565b949350505050565b606082471015610d5f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161017c565b600080866001600160a01b03168587604051610d7b91906114a4565b60006040518083038185875af1925050503d8060008114610db8576040519150601f19603f3d011682016040523d82523d6000602084013e610dbd565b606091505b5091509150610dce87838387610dd9565b979650505050505050565b60608315610e48578251600003610e41576001600160a01b0385163b610e415760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161017c565b5081610cf6565b610cf68383815115610e5d5781518083602001fd5b8060405162461bcd60e51b815260040161017c91906114c0565b6001600160a01b038116811461091a57600080fd5b600060208284031215610e9e57600080fd5b8135610ea981610e77565b9392505050565b67ffffffffffffffff8116811461091a57600080fd5b60008083601f840112610ed857600080fd5b50813567ffffffffffffffff811115610ef057600080fd5b602083019150836020828501011115610f0857600080fd5b9250929050565b600080600080600060808688031215610f2757600080fd5b8535610f3281610eb0565b94506020860135610f4281610e77565b935060408601359250606086013567ffffffffffffffff811115610f6557600080fd5b610f7188828901610ec6565b969995985093965092949392505050565b63ffffffff8116811461091a57600080fd5b60008060008060008060a08789031215610fad57600080fd5b8635610fb881610eb0565b95506020870135610fc881610e77565b9450604087013593506060870135610fdf81610f82565b9250608087013567ffffffffffffffff811115610ffb57600080fd5b61100789828a01610ec6565b979a9699509497509295939492505050565b6020808252600a90820152696f6e6c794f776e65727360b01b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b604051610160810167ffffffffffffffff811182821017156110775761107761103d565b60405290565b60405160c0810167ffffffffffffffff811182821017156110775761107761103d565b80516110ab81610f82565b919050565b80516110ab81610e77565b600061016082840312156110ce57600080fd5b6110d6611053565b90506110e1826110a0565b81526110ef602083016110a0565b6020820152611100604083016110a0565b6040820152611111606083016110a0565b6060820152611122608083016110b0565b608082015261113360a083016110b0565b60a082015261114460c083016110b0565b60c082015261115560e083016110b0565b60e0820152610100828101519082015261012080830151908201526101409182015191810191909152919050565b60005b8381101561119e578181015183820152602001611186565b50506000910152565b600060c082840312156111b957600080fd5b6111c161107d565b905081516111ce81610f82565b815260208201516111de81610e77565b602082015260408201516111f181610e77565b80604083015250606082015160608201526080820151608082015260a082015167ffffffffffffffff8082111561122757600080fd5b818401915084601f83011261123b57600080fd5b81518181111561124d5761124d61103d565b604051601f8201601f19908116603f011681019083821181831017156112755761127561103d565b8160405282815287602084870101111561128e57600080fd5b61129f836020830160208801611183565b60a0860152509295945050505050565b6000602082840312156112c157600080fd5b815167ffffffffffffffff808211156112d957600080fd5b9083019061020082860312156112ee57600080fd5b6112f661107d565b825161130181610eb0565b8152602083015161131181610f82565b6020820152611322604084016110a0565b60408201526060830151606082015261133e86608085016110bb565b60808201526101e08301518281111561135657600080fd5b611362878286016111a7565b60a08301525095945050505050565b60006020828403121561138357600080fd5b8151610ea981610e77565b6000602082840312156113a057600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905260009061140b90830184866113a7565b98975050505050505050565b67ffffffffffffffff8716815260018060a01b038616602082015284604082015263ffffffff8416606082015260a06080820152600061140b60a0830184866113a7565b8082018082111561147c57634e487b7160e01b600052601160045260246000fd5b92915050565b60006020828403121561149457600080fd5b81518015158114610ea957600080fd5b600082516114b6818460208701611183565b9190910192915050565b60208152600082518060208401526114df816040850160208701611183565b601f01601f1916919091016040019291505056fea2646970667358221220ad155ec9c6e3df240c8f4e315e5a39d2f975bd602598f4d9ff6b9f1ec313a63264736f6c63430008100033",
|
|
135
|
+
"linkReferences": {},
|
|
136
|
+
"deployedLinkReferences": {}
|
|
137
|
+
}
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { TWAP } from "../typechain-hardhat/contracts";
|
|
|
4
4
|
import type { Lens } from "../typechain-hardhat/contracts/periphery";
|
|
5
5
|
export declare const twapAbi: any;
|
|
6
6
|
export declare const lensAbi: any;
|
|
7
|
+
export declare const takerAbi: any;
|
|
7
8
|
export declare class TWAPLib {
|
|
8
9
|
config: Config;
|
|
9
10
|
maker: string;
|
package/dist/src/lib.js
CHANGED
|
@@ -12,16 +12,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TokensValidation = exports.OrderInputValidation = exports.Status = exports.TWAPLib = exports.lensAbi = exports.twapAbi = void 0;
|
|
15
|
+
exports.TokensValidation = exports.OrderInputValidation = exports.Status = exports.TWAPLib = exports.takerAbi = exports.lensAbi = exports.twapAbi = void 0;
|
|
16
16
|
const configs_1 = require("./configs");
|
|
17
17
|
const web3_1 = __importDefault(require("web3"));
|
|
18
18
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
19
19
|
const web3_candies_1 = require("@defi.org/web3-candies");
|
|
20
20
|
const TWAP_json_1 = __importDefault(require("../artifacts/contracts/TWAP.sol/TWAP.json"));
|
|
21
21
|
const Lens_json_1 = __importDefault(require("../artifacts/contracts/periphery/Lens.sol/Lens.json"));
|
|
22
|
+
const Taker_json_1 = __importDefault(require("../artifacts/contracts/periphery/Taker.sol/Taker.json"));
|
|
22
23
|
const lodash_1 = __importDefault(require("lodash"));
|
|
23
24
|
exports.twapAbi = TWAP_json_1.default.abi;
|
|
24
25
|
exports.lensAbi = Lens_json_1.default.abi;
|
|
26
|
+
exports.takerAbi = Taker_json_1.default.abi;
|
|
25
27
|
class TWAPLib {
|
|
26
28
|
constructor(config, maker, provider) {
|
|
27
29
|
this.config = config;
|
|
@@ -36,7 +38,7 @@ class TWAPLib {
|
|
|
36
38
|
.toNumber();
|
|
37
39
|
this.srcChunkAmount = (srcAmount, totalChunks) => (0, bignumber_js_1.default)(srcAmount).div(totalChunks).integerValue(bignumber_js_1.default.ROUND_FLOOR);
|
|
38
40
|
this.totalChunks = (srcAmount, srcChunkAmount) => (0, bignumber_js_1.default)(srcAmount).div(srcChunkAmount).integerValue(bignumber_js_1.default.ROUND_CEIL).toNumber();
|
|
39
|
-
this.fillDelayMillis = (totalChunks, maxDurationMillis) => (0, bignumber_js_1.default)(totalChunks).lte(1) || (0, bignumber_js_1.default)(maxDurationMillis).lte(this.config.bidDelaySeconds)
|
|
41
|
+
this.fillDelayMillis = (totalChunks, maxDurationMillis) => (0, bignumber_js_1.default)(totalChunks).lte(1) || (0, bignumber_js_1.default)(maxDurationMillis).lte(this.config.bidDelaySeconds * 1000 * 2)
|
|
40
42
|
? 0
|
|
41
43
|
: bignumber_js_1.default.max((0, bignumber_js_1.default)(maxDurationMillis)
|
|
42
44
|
.div(totalChunks)
|
package/dist/src/paraswap.js
CHANGED
|
@@ -52,6 +52,7 @@ var Paraswap;
|
|
|
52
52
|
}
|
|
53
53
|
Paraswap.priceUsd = priceUsd;
|
|
54
54
|
function findRoute(chainId, src, dst, amountIn, onlyDex) {
|
|
55
|
+
var _a, _b;
|
|
55
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
57
|
const params = new URLSearchParams({
|
|
57
58
|
srcToken: src.address,
|
|
@@ -62,7 +63,7 @@ var Paraswap;
|
|
|
62
63
|
network: chainId.toString(),
|
|
63
64
|
side: "SELL",
|
|
64
65
|
includeDEXS: onlyDex || "",
|
|
65
|
-
|
|
66
|
+
partner: ((_b = (_a = onlyDex === null || onlyDex === void 0 ? void 0 : onlyDex.toLowerCase()) === null || _a === void 0 ? void 0 : _a.split(",")) === null || _b === void 0 ? void 0 : _b[0]) || "",
|
|
66
67
|
// otherExchangePrices: "true",
|
|
67
68
|
});
|
|
68
69
|
const response = yield fetch(`${URL}/prices/?${params}`);
|