@requestnetwork/smart-contracts 0.32.1-next.1986 → 0.32.1-next.1988
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.
- package/README.md +7 -0
- package/dist/deploy/deploy-zk-batch-contracts.js +1 -1
- package/dist/deploy/deploy-zk-batch-contracts.js.map +1 -1
- package/dist/deploy/utils-zk.js +1 -1
- package/dist/deploy/utils-zk.js.map +1 -1
- package/dist/hardhat.config.d.ts.map +1 -1
- package/dist/hardhat.config.js +9 -17
- package/dist/hardhat.config.js.map +1 -1
- package/dist/scripts/deploy-storage.js +1 -1
- package/dist/scripts/deploy-storage.js.map +1 -1
- package/dist/scripts/test-deploy-all.js +3 -3
- package/dist/scripts/test-deploy-all.js.map +1 -1
- package/dist/scripts-create2/constructor-args.js +2 -1
- package/dist/scripts-create2/constructor-args.js.map +1 -1
- package/dist/scripts-create2/contract-setup/adminTasks.d.ts +44 -10
- package/dist/scripts-create2/contract-setup/adminTasks.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/adminTasks.js +135 -34
- package/dist/scripts-create2/contract-setup/adminTasks.js.map +1 -1
- package/dist/scripts-create2/contract-setup/execute-contract-method.d.ts +11 -0
- package/dist/scripts-create2/contract-setup/execute-contract-method.d.ts.map +1 -0
- package/dist/scripts-create2/contract-setup/execute-contract-method.js +65 -0
- package/dist/scripts-create2/contract-setup/execute-contract-method.js.map +1 -0
- package/dist/scripts-create2/contract-setup/setupBatchConversionPayments.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setupBatchConversionPayments.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setupBatchConversionPayments.js +15 -9
- package/dist/scripts-create2/contract-setup/setupBatchConversionPayments.js.map +1 -1
- package/dist/scripts-create2/contract-setup/setupChainlinkConversionPath.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setupChainlinkConversionPath.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setupChainlinkConversionPath.js +3 -2
- package/dist/scripts-create2/contract-setup/setupChainlinkConversionPath.js.map +1 -1
- package/dist/scripts-create2/contract-setup/setupERC20SwapToConversion.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setupERC20SwapToConversion.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setupERC20SwapToConversion.js +5 -4
- package/dist/scripts-create2/contract-setup/setupERC20SwapToConversion.js.map +1 -1
- package/dist/scripts-create2/contract-setup/setupERC20SwapToPay.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setupERC20SwapToPay.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setupERC20SwapToPay.js +4 -3
- package/dist/scripts-create2/contract-setup/setupERC20SwapToPay.js.map +1 -1
- package/dist/scripts-create2/contract-setup/setupETHConversionProxy.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setupETHConversionProxy.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setupETHConversionProxy.js +5 -4
- package/dist/scripts-create2/contract-setup/setupETHConversionProxy.js.map +1 -1
- package/dist/scripts-create2/contract-setup/setupErc20ConversionProxy.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setupErc20ConversionProxy.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setupErc20ConversionProxy.js +4 -3
- package/dist/scripts-create2/contract-setup/setupErc20ConversionProxy.js.map +1 -1
- package/dist/scripts-create2/contract-setup/setups.d.ts +3 -1
- package/dist/scripts-create2/contract-setup/setups.d.ts.map +1 -1
- package/dist/scripts-create2/contract-setup/setups.js +8 -7
- package/dist/scripts-create2/contract-setup/setups.js.map +1 -1
- package/dist/scripts-create2/deploy.d.ts.map +1 -1
- package/dist/scripts-create2/deploy.js +6 -1
- package/dist/scripts-create2/deploy.js.map +1 -1
- package/dist/scripts-create2/tenderly.js +3 -3
- package/dist/scripts-create2/tenderly.js.map +1 -1
- package/dist/scripts-create2/update-contracts-setup.d.ts +1 -1
- package/dist/scripts-create2/update-contracts-setup.d.ts.map +1 -1
- package/dist/scripts-create2/update-contracts-setup.js +2 -1
- package/dist/scripts-create2/update-contracts-setup.js.map +1 -1
- package/dist/scripts-create2/utils.js +2 -1
- package/dist/scripts-create2/utils.js.map +1 -1
- package/dist/src/lib/artifacts/Admin/0.1.0.json +10 -0
- package/dist/src/lib/artifacts/Admin/index.d.ts +7 -0
- package/dist/src/lib/artifacts/Admin/index.d.ts.map +1 -0
- package/dist/src/lib/artifacts/Admin/index.js +25 -0
- package/dist/src/lib/artifacts/Admin/index.js.map +1 -0
- package/dist/src/lib/artifacts/BatchPayments/index.d.ts.map +1 -1
- package/dist/src/lib/artifacts/BatchPayments/index.js +0 -8
- package/dist/src/lib/artifacts/BatchPayments/index.js.map +1 -1
- package/dist/src/lib/artifacts/index.d.ts +4 -0
- package/dist/src/lib/artifacts/index.d.ts.map +1 -1
- package/dist/src/lib/artifacts/index.js +4 -0
- package/dist/src/lib/artifacts/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -5
- package/dist/scripts/deploy-payments.d.ts +0 -18
- package/dist/scripts/deploy-payments.d.ts.map +0 -1
- package/dist/scripts/deploy-payments.js +0 -285
- package/dist/scripts/deploy-payments.js.map +0 -1
|
@@ -4,11 +4,12 @@ exports.getSignerAndGasFees = exports.updateNativeTokenHash = exports.updateNati
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const lib_1 = require("../../src/lib");
|
|
6
6
|
const utils_1 = require("../../scripts/utils");
|
|
7
|
-
const artifacts = require("../../src/lib");
|
|
7
|
+
const artifacts = tslib_1.__importStar(require("../../src/lib"));
|
|
8
8
|
const ethers_1 = require("ethers");
|
|
9
9
|
const utils_2 = require("ethers/lib/utils");
|
|
10
10
|
const utils_3 = require("@requestnetwork/utils");
|
|
11
11
|
const fee_suggestion_1 = require("../fee-suggestion");
|
|
12
|
+
const execute_contract_method_1 = require("./execute-contract-method");
|
|
12
13
|
// Swap Fees: set to 5 for 0.5%
|
|
13
14
|
const REQUEST_SWAP_FEES = 0;
|
|
14
15
|
// Batch Fees: set to 30 for 0.3%
|
|
@@ -21,33 +22,72 @@ const BATCH_FEE_AMOUNT_USD_LIMIT = (0, utils_2.parseUnits)('150', 8);
|
|
|
21
22
|
* Erc20ConversionProxy | EthConversionProxy | ERC20SwapToConversion.
|
|
22
23
|
* @param network The network used.
|
|
23
24
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
25
|
+
* @param signer Who is performing the updating
|
|
26
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
24
27
|
* @param version The version of the chainlink proxy to use, the last one by default.
|
|
25
28
|
*/
|
|
26
|
-
const updateChainlinkConversionPath = (contract, network, txOverrides, version) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const updateChainlinkConversionPath = (contract, network, txOverrides, signer, signWithEoa, version) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
30
|
const currentChainlinkAddress = yield contract.chainlinkConversionPath();
|
|
28
31
|
const chainlinkConversionPathAddress = lib_1.chainlinkConversionPath.getAddress(network, version);
|
|
29
32
|
if (currentChainlinkAddress !== chainlinkConversionPathAddress) {
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
34
|
+
network,
|
|
35
|
+
contract,
|
|
36
|
+
method: 'updateConversionPathAddress',
|
|
37
|
+
props: [chainlinkConversionPathAddress],
|
|
38
|
+
txOverrides,
|
|
39
|
+
signer,
|
|
40
|
+
signWithEoa,
|
|
41
|
+
});
|
|
32
42
|
console.log(`chainlink: the current address ${currentChainlinkAddress} has been replaced by: ${chainlinkConversionPathAddress}`);
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
45
|
exports.updateChainlinkConversionPath = updateChainlinkConversionPath;
|
|
36
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Updates the batchFee applied by the batch conversion proxy.
|
|
48
|
+
* @param contract BatchConversionPayments contract.
|
|
49
|
+
* @param network The network used
|
|
50
|
+
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
51
|
+
* @param signer Who is performing the updating
|
|
52
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
53
|
+
*/
|
|
54
|
+
const updateSwapRouter = (contract, network, txOverrides, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
55
|
const currentSwapRouter = yield contract.swapRouter();
|
|
38
56
|
const expectedRouter = utils_1.uniswapV2RouterAddresses[network];
|
|
39
57
|
if (expectedRouter && currentSwapRouter !== expectedRouter) {
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
59
|
+
network,
|
|
60
|
+
contract,
|
|
61
|
+
method: 'setRouter',
|
|
62
|
+
props: [expectedRouter],
|
|
63
|
+
txOverrides,
|
|
64
|
+
signer,
|
|
65
|
+
signWithEoa,
|
|
66
|
+
});
|
|
42
67
|
console.log(`Swap router address set to ${expectedRouter}`);
|
|
43
68
|
}
|
|
44
69
|
});
|
|
45
70
|
exports.updateSwapRouter = updateSwapRouter;
|
|
46
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Updates the batchFee applied by the batch conversion proxy.
|
|
73
|
+
* @param contract BatchConversionPayments contract.
|
|
74
|
+
* @param network The network used
|
|
75
|
+
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
76
|
+
* @param signer Who is performing the updating
|
|
77
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
78
|
+
*/
|
|
79
|
+
const updateRequestSwapFees = (contract, network, txOverrides, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
47
80
|
const currentFees = yield contract.requestSwapFees();
|
|
48
81
|
if (!currentFees.eq(REQUEST_SWAP_FEES)) {
|
|
49
|
-
|
|
50
|
-
|
|
82
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
83
|
+
network,
|
|
84
|
+
contract,
|
|
85
|
+
method: 'updateRequestSwapFees',
|
|
86
|
+
props: [REQUEST_SWAP_FEES],
|
|
87
|
+
txOverrides,
|
|
88
|
+
signer,
|
|
89
|
+
signWithEoa,
|
|
90
|
+
});
|
|
51
91
|
console.log(`currentFees: ${currentFees.toNumber() / 10}%, new fees: ${REQUEST_SWAP_FEES / 10}%`);
|
|
52
92
|
}
|
|
53
93
|
});
|
|
@@ -55,13 +95,23 @@ exports.updateRequestSwapFees = updateRequestSwapFees;
|
|
|
55
95
|
/**
|
|
56
96
|
* Updates the batchFee applied by the batch conversion proxy.
|
|
57
97
|
* @param contract BatchConversionPayments contract.
|
|
98
|
+
* @param network The network used
|
|
58
99
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
100
|
+
* @param signer Who is performing the updating
|
|
101
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
59
102
|
*/
|
|
60
|
-
const updateBatchPaymentFees = (contract, txOverrides) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
103
|
+
const updateBatchPaymentFees = (contract, network, txOverrides, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
61
104
|
const currentFees = yield contract.batchFee();
|
|
62
105
|
if (!BATCH_FEE.eq(currentFees)) {
|
|
63
|
-
|
|
64
|
-
|
|
106
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
107
|
+
network,
|
|
108
|
+
contract,
|
|
109
|
+
method: 'setBatchFee',
|
|
110
|
+
props: [BATCH_FEE],
|
|
111
|
+
txOverrides,
|
|
112
|
+
signer,
|
|
113
|
+
signWithEoa,
|
|
114
|
+
});
|
|
65
115
|
console.log(`Batch: currentFees: ${currentFees.toString()}, new fees: ${BATCH_FEE.toString()}`);
|
|
66
116
|
}
|
|
67
117
|
});
|
|
@@ -69,13 +119,23 @@ exports.updateBatchPaymentFees = updateBatchPaymentFees;
|
|
|
69
119
|
/**
|
|
70
120
|
* Updates the feeAMountUSDLimit of the batch conversion proxy.
|
|
71
121
|
* @param contract BatchConversionPayments contract.
|
|
122
|
+
* @param network The network used
|
|
72
123
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
124
|
+
* @param signer Who is performing the updating
|
|
125
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
73
126
|
*/
|
|
74
|
-
const updateBatchPaymentFeeAmountUSDLimit = (contract, txOverrides) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
+
const updateBatchPaymentFeeAmountUSDLimit = (contract, network, txOverrides, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
75
128
|
const currentFeeAmountUSDLimit = yield contract.batchFeeAmountUSDLimit();
|
|
76
129
|
if (!currentFeeAmountUSDLimit.eq(BATCH_FEE_AMOUNT_USD_LIMIT)) {
|
|
77
|
-
|
|
78
|
-
|
|
130
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
131
|
+
network,
|
|
132
|
+
contract,
|
|
133
|
+
method: 'setBatchFeeAmountUSDLimit',
|
|
134
|
+
props: [BATCH_FEE_AMOUNT_USD_LIMIT],
|
|
135
|
+
txOverrides,
|
|
136
|
+
signer,
|
|
137
|
+
signWithEoa,
|
|
138
|
+
});
|
|
79
139
|
console.log(`Batch: the current fee amount in USD limit: ${currentFeeAmountUSDLimit.toString()}, have been replaced by: ${BATCH_FEE_AMOUNT_USD_LIMIT.toString()}. ($1 = 1e8)`);
|
|
80
140
|
}
|
|
81
141
|
});
|
|
@@ -86,9 +146,11 @@ exports.updateBatchPaymentFeeAmountUSDLimit = updateBatchPaymentFeeAmountUSDLimi
|
|
|
86
146
|
* @param network The network used.
|
|
87
147
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
88
148
|
* @param proxyType The type of the proxy fee.
|
|
149
|
+
* @param signer Who is performing the updating
|
|
150
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
89
151
|
* @param version The version of the fee proxy to use, the last one by default.
|
|
90
152
|
*/
|
|
91
|
-
const updatePaymentFeeProxyAddress = (contract, network, txOverrides, proxyType, version) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
153
|
+
const updatePaymentFeeProxyAddress = (contract, network, txOverrides, proxyType, signer, signWithEoa, version) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
92
154
|
let proxyAddress;
|
|
93
155
|
let currentAddress;
|
|
94
156
|
if (proxyType === 'native') {
|
|
@@ -100,8 +162,15 @@ const updatePaymentFeeProxyAddress = (contract, network, txOverrides, proxyType,
|
|
|
100
162
|
currentAddress = yield contract.paymentProxy();
|
|
101
163
|
}
|
|
102
164
|
if (currentAddress.toLocaleLowerCase() !== proxyAddress.toLocaleLowerCase()) {
|
|
103
|
-
|
|
104
|
-
|
|
165
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
166
|
+
network,
|
|
167
|
+
contract,
|
|
168
|
+
method: 'updateConversionProxyAddress',
|
|
169
|
+
props: [proxyAddress],
|
|
170
|
+
txOverrides,
|
|
171
|
+
signer,
|
|
172
|
+
signWithEoa,
|
|
173
|
+
});
|
|
105
174
|
console.log(`${proxyType} conversion proxy: the current address ${currentAddress} has been replaced by: ${proxyAddress}`);
|
|
106
175
|
}
|
|
107
176
|
});
|
|
@@ -112,41 +181,53 @@ exports.updatePaymentFeeProxyAddress = updatePaymentFeeProxyAddress;
|
|
|
112
181
|
* @param network The network used.
|
|
113
182
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
114
183
|
* @param proxyName The name of the fee proxy to update.
|
|
184
|
+
* @param signer Who is performing the updating
|
|
185
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
115
186
|
*/
|
|
116
|
-
const updateBatchConversionProxy = (contract, network, txOverrides, proxyName) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
187
|
+
const updateBatchConversionProxy = (contract, network, txOverrides, proxyName, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
117
188
|
let proxyAddress;
|
|
118
|
-
let
|
|
189
|
+
let method;
|
|
119
190
|
let currentAddress;
|
|
120
191
|
switch (proxyName) {
|
|
121
192
|
case 'native':
|
|
122
193
|
proxyAddress = artifacts.ethereumFeeProxyArtifact.getAddress(network);
|
|
123
|
-
|
|
194
|
+
method = 'setPaymentNativeProxy';
|
|
124
195
|
currentAddress = yield contract.paymentNativeProxy();
|
|
125
196
|
break;
|
|
126
197
|
case 'nativeConversion':
|
|
127
198
|
proxyAddress = artifacts.ethConversionArtifact.getAddress(network);
|
|
128
|
-
|
|
199
|
+
method = 'setPaymentNativeConversionProxy';
|
|
129
200
|
currentAddress = yield contract.paymentNativeConversionProxy();
|
|
130
201
|
break;
|
|
131
202
|
case 'erc20':
|
|
132
203
|
proxyAddress = artifacts.erc20FeeProxyArtifact.getAddress(network);
|
|
133
|
-
|
|
204
|
+
method = 'setPaymentErc20Proxy';
|
|
134
205
|
currentAddress = yield contract.paymentErc20Proxy();
|
|
135
206
|
break;
|
|
136
207
|
case 'erc20Conversion':
|
|
137
208
|
proxyAddress = artifacts.erc20ConversionProxy.getAddress(network);
|
|
138
|
-
|
|
209
|
+
method = 'setPaymentErc20ConversionProxy';
|
|
139
210
|
currentAddress = yield contract.paymentErc20ConversionProxy();
|
|
140
211
|
break;
|
|
141
212
|
case 'chainlinkConversionPath':
|
|
142
213
|
proxyAddress = artifacts.chainlinkConversionPath.getAddress(network);
|
|
143
|
-
|
|
214
|
+
method = 'setChainlinkConversionPath';
|
|
144
215
|
currentAddress = yield contract.chainlinkConversionPath();
|
|
145
216
|
break;
|
|
217
|
+
default: {
|
|
218
|
+
throw new Error(`${proxyName} not supported`);
|
|
219
|
+
}
|
|
146
220
|
}
|
|
147
221
|
if (currentAddress.toLocaleLowerCase() !== proxyAddress.toLocaleLowerCase()) {
|
|
148
|
-
|
|
149
|
-
|
|
222
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
223
|
+
network,
|
|
224
|
+
contract,
|
|
225
|
+
method,
|
|
226
|
+
props: [proxyAddress],
|
|
227
|
+
txOverrides,
|
|
228
|
+
signer,
|
|
229
|
+
signWithEoa,
|
|
230
|
+
});
|
|
150
231
|
console.log(`${proxyName}: the current address ${currentAddress} has been replaced by: ${proxyAddress}`);
|
|
151
232
|
}
|
|
152
233
|
});
|
|
@@ -157,14 +238,23 @@ exports.updateBatchConversionProxy = updateBatchConversionProxy;
|
|
|
157
238
|
* @param NativeAddress The address of native token, eg: ETH.
|
|
158
239
|
* @param USDAddress The address of USD token.
|
|
159
240
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
241
|
+
* @param signer Who is performing the updating
|
|
242
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
160
243
|
*/
|
|
161
|
-
const updateNativeAndUSDAddress = (contract, NativeAddress, USDAddress, txOverrides) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
244
|
+
const updateNativeAndUSDAddress = (contract, network, NativeAddress, USDAddress, txOverrides, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
162
245
|
const currentUSDAddress = (yield contract.USDAddress()).toLocaleLowerCase();
|
|
163
246
|
const currentNativeAddress = (yield contract.NativeAddress()).toLocaleLowerCase();
|
|
164
247
|
if (currentNativeAddress !== NativeAddress.toLocaleLowerCase() ||
|
|
165
248
|
currentUSDAddress !== USDAddress.toLocaleLowerCase()) {
|
|
166
|
-
|
|
167
|
-
|
|
249
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
250
|
+
network,
|
|
251
|
+
contract,
|
|
252
|
+
method: 'setNativeAndUSDAddress',
|
|
253
|
+
props: [NativeAddress, USDAddress],
|
|
254
|
+
txOverrides,
|
|
255
|
+
signer,
|
|
256
|
+
signWithEoa,
|
|
257
|
+
});
|
|
168
258
|
console.log(`Batch: the current NativeAddress: ${currentNativeAddress}, have been replaced by: ${NativeAddress}`);
|
|
169
259
|
console.log(`Batch: the current USDAddress: ${currentUSDAddress}, have been replaced by: ${USDAddress}`);
|
|
170
260
|
}
|
|
@@ -172,15 +262,26 @@ const updateNativeAndUSDAddress = (contract, NativeAddress, USDAddress, txOverri
|
|
|
172
262
|
exports.updateNativeAndUSDAddress = updateNativeAndUSDAddress;
|
|
173
263
|
/**
|
|
174
264
|
* Update the native token hash used by a contract.
|
|
265
|
+
* @param contractType name of the contract to be updated
|
|
175
266
|
* @param contract contract to be updated.
|
|
267
|
+
* @param network where the contract is deployed
|
|
176
268
|
* @param nativeTokenHash The address of native token, eg: ETH.
|
|
177
269
|
* @param txOverrides information related to gas fees. Increase their values if needed.
|
|
270
|
+
* @param signer Who is performing the updating
|
|
271
|
+
* @param signWithEoa Is the transaction to be signed by an EAO
|
|
178
272
|
*/
|
|
179
|
-
const updateNativeTokenHash = (contractType, contract, nativeTokenHash, txOverrides) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
273
|
+
const updateNativeTokenHash = (contractType, contract, network, nativeTokenHash, txOverrides, signer, signWithEoa) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
180
274
|
const currentNativeTokenHash = (yield contract.nativeTokenHash()).toLocaleLowerCase();
|
|
181
275
|
if (currentNativeTokenHash !== nativeTokenHash.toLocaleLowerCase()) {
|
|
182
|
-
|
|
183
|
-
|
|
276
|
+
yield (0, execute_contract_method_1.executeContractMethod)({
|
|
277
|
+
network,
|
|
278
|
+
contract,
|
|
279
|
+
method: 'updateNativeTokenHash',
|
|
280
|
+
props: [nativeTokenHash],
|
|
281
|
+
txOverrides,
|
|
282
|
+
signer,
|
|
283
|
+
signWithEoa,
|
|
284
|
+
});
|
|
184
285
|
console.log(`${contractType}: the current NativeTokenHash: ${currentNativeTokenHash}, have been replaced by: ${nativeTokenHash}`);
|
|
185
286
|
}
|
|
186
287
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adminTasks.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/adminTasks.ts"],"names":[],"mappings":";;;;AAAA,uCAAwD;AACxD,+CAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file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G,YAAY,kCAAkC,sBAAsB,4BAA4B,eAAe,EAAE,CACrH,CAAC;KACH;AACH,CAAC,CAAA,CAAC;AAxBW,QAAA,qBAAqB,yBAwBhC;AAEF;;;;;;;GAOG;AACI,MAAM,mBAAmB,GAAG,CACjC,OAAe,EACf,GAAsC,EAOrC,EAAE;IACH,IAAI,QAAQ,CAAC;IACb,IAAI,OAAO,KAAK,MAAM,EAAE;QACtB,QAAQ,GAAG,IAAA,uBAAe,GAAE,CAAC;KAC9B;SAAM;QACL,QAAQ,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC;KACxC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAElF,MAAM,WAAW,GAAG,CAAC,MAAM,IAAA,0BAAkB,EAAC,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,MAAM,IAAA,wBAAgB,EAAC;YACrB,MAAM,EAAE,OAAO;YACf,WAAW,EAAE,IAAA,mCAAkB,EAAC,QAAQ,CAAC;SAC1C,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;QACL,MAAM;QACN,WAAW;KACZ,CAAC;AACJ,CAAC,CAAA,CAAC;AA7BW,QAAA,mBAAmB,uBA6B9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Contract, Overrides, Wallet } from 'ethers';
|
|
2
|
+
export declare const executeContractMethod: ({ network, contract, method, props, txOverrides, signer, signWithEoa, }: {
|
|
3
|
+
network: string;
|
|
4
|
+
contract: Contract;
|
|
5
|
+
method: string;
|
|
6
|
+
props: any[];
|
|
7
|
+
txOverrides: Overrides;
|
|
8
|
+
signer: Wallet;
|
|
9
|
+
signWithEoa?: boolean | undefined;
|
|
10
|
+
}) => Promise<void>;
|
|
11
|
+
//# sourceMappingURL=execute-contract-method.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-contract-method.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/execute-contract-method.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAoBrD,eAAO,MAAM,qBAAqB;aASvB,MAAM;cACL,QAAQ;YACV,MAAM;WACP,GAAG,EAAE;iBACC,SAAS;YACd,MAAM;;MAEZ,QAAQ,IAAI,CA2Cf,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeContractMethod = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const api_kit_1 = tslib_1.__importDefault(require("@safe-global/api-kit"));
|
|
6
|
+
const lib_1 = require("../../src/lib/");
|
|
7
|
+
const protocol_kit_1 = tslib_1.__importStar(require("@safe-global/protocol-kit"));
|
|
8
|
+
const ethers_1 = require("ethers");
|
|
9
|
+
const txServiceUrls = {
|
|
10
|
+
mainnet: 'https://safe-transaction-mainnet.safe.global/',
|
|
11
|
+
goerli: 'https://safe-transaction-goerli.safe.global/',
|
|
12
|
+
sepolia: 'https://safe-transaction-sepolia.safe.global/',
|
|
13
|
+
matic: 'https://safe-transaction-polygon.safe.global/',
|
|
14
|
+
celo: 'https://safe-transaction-celo.safe.global/',
|
|
15
|
+
xsai: 'https://safe-transaction-gnosis-chain.safe.global/',
|
|
16
|
+
bsc: 'https://safe-transaction-bsc.safe.global/',
|
|
17
|
+
'arbitrum-one': 'https://safe-transaction-arbitrum.safe.global/',
|
|
18
|
+
avalanche: 'https://safe-transaction-avalanche.safe.global/',
|
|
19
|
+
optimism: 'https://safe-transaction-optimism.safe.global/',
|
|
20
|
+
zksyncera: 'https://safe-transaction-zksync.safe.global/',
|
|
21
|
+
};
|
|
22
|
+
const executeContractMethod = ({ network, contract, method, props, txOverrides, signer, signWithEoa, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
if (!signWithEoa) {
|
|
24
|
+
const safeAddress = lib_1.safeAdminArtifact.getAddress(network);
|
|
25
|
+
const txServiceUrl = txServiceUrls[network];
|
|
26
|
+
if (!safeAddress || !txServiceUrl) {
|
|
27
|
+
throw new Error(`Can't administrate using Safe on ${network}`);
|
|
28
|
+
}
|
|
29
|
+
const ethAdapter = new protocol_kit_1.EthersAdapter({
|
|
30
|
+
ethers: ethers_1.ethers,
|
|
31
|
+
signerOrProvider: signer,
|
|
32
|
+
});
|
|
33
|
+
const safeService = new api_kit_1.default({ txServiceUrl, ethAdapter });
|
|
34
|
+
const safeSdk = yield protocol_kit_1.default.create({ ethAdapter, safeAddress });
|
|
35
|
+
const safeTransactionData = [
|
|
36
|
+
{
|
|
37
|
+
to: contract.address,
|
|
38
|
+
data: contract.interface.encodeFunctionData(method, props),
|
|
39
|
+
value: '0',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
const nonce = yield safeService.getNextNonce(safeAddress);
|
|
43
|
+
const safeTransaction = yield safeSdk.createTransaction({
|
|
44
|
+
safeTransactionData,
|
|
45
|
+
options: { nonce },
|
|
46
|
+
});
|
|
47
|
+
const safeTxHash = yield safeSdk.getTransactionHash(safeTransaction);
|
|
48
|
+
const senderSignature = yield safeSdk.signTransactionHash(safeTxHash);
|
|
49
|
+
yield safeService.proposeTransaction({
|
|
50
|
+
safeAddress,
|
|
51
|
+
safeTransactionData: safeTransaction.data,
|
|
52
|
+
safeTxHash,
|
|
53
|
+
senderAddress: signer.address,
|
|
54
|
+
senderSignature: senderSignature.data,
|
|
55
|
+
});
|
|
56
|
+
console.log(`Transaction to be confirmed in Safe ${safeAddress} on ${network}`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const contractConnected = contract.connect(signer);
|
|
60
|
+
const tx = yield contractConnected[method](...props, txOverrides);
|
|
61
|
+
yield tx.wait(1);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
exports.executeContractMethod = executeContractMethod;
|
|
65
|
+
//# sourceMappingURL=execute-contract-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-contract-method.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/execute-contract-method.ts"],"names":[],"mappings":";;;;AAAA,2EAA8C;AAE9C,wCAAmD;AACnD,kFAAqF;AACrF,mCAAgC;AAGhC,MAAM,aAAa,GAA2B;IAC5C,OAAO,EAAE,+CAA+C;IACxD,MAAM,EAAE,8CAA8C;IACtD,OAAO,EAAE,+CAA+C;IACxD,KAAK,EAAE,+CAA+C;IACtD,IAAI,EAAE,4CAA4C;IAClD,IAAI,EAAE,oDAAoD;IAC1D,GAAG,EAAE,2CAA2C;IAChD,cAAc,EAAE,gDAAgD;IAChE,SAAS,EAAE,iDAAiD;IAC5D,QAAQ,EAAE,gDAAgD;IAC1D,SAAS,EAAE,8CAA8C;CAC1D,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAO,EAC1C,OAAO,EACP,QAAQ,EACR,MAAM,EACN,KAAK,EACL,WAAW,EACX,MAAM,EACN,WAAW,GASZ,EAAiB,EAAE;IAClB,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,WAAW,GAAG,uBAAiB,CAAC,UAAU,CAAC,OAAoC,CAAC,CAAC;QACvF,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,WAAW,IAAI,CAAC,YAAY,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,oCAAoC,OAAO,EAAE,CAAC,CAAC;SAChE;QAED,MAAM,UAAU,GAAG,IAAI,4BAAa,CAAC;YACnC,MAAM,EAAN,eAAM;YACN,gBAAgB,EAAE,MAAM;SACS,CAAC,CAAC;QACrC,MAAM,WAAW,GAAG,IAAI,iBAAU,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC;QAC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ntimeEnvironmentExtended } from '../types';
|
|
|
4
4
|
* @param contractAddress address of the BatchConversionPayments contract.
|
|
5
5
|
* If not provided fallback to the latest deployment address
|
|
6
6
|
* @param hre Hardhat runtime environment.
|
|
7
|
+
* @param signWithEoa Are transactions to be signed by an EAO
|
|
7
8
|
*/
|
|
8
|
-
export declare const setupBatchConversionPayments: ({ contractAddress, hre, }: {
|
|
9
|
+
export declare const setupBatchConversionPayments: ({ contractAddress, hre, signWithEoa, }: {
|
|
9
10
|
contractAddress?: string | undefined;
|
|
10
11
|
hre: HardhatRuntimeEnvironmentExtended;
|
|
12
|
+
signWithEoa: boolean;
|
|
11
13
|
}) => Promise<void>;
|
|
12
14
|
//# sourceMappingURL=setupBatchConversionPayments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupBatchConversionPayments.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupBatchConversionPayments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAW7D
|
|
1
|
+
{"version":3,"file":"setupBatchConversionPayments.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupBatchConversionPayments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAW7D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;SAMlC,iCAAiC;iBACzB,OAAO;MAClB,QAAQ,IAAI,CA4Ef,CAAC"}
|
|
@@ -11,8 +11,9 @@ const types_1 = require("@requestnetwork/types");
|
|
|
11
11
|
* @param contractAddress address of the BatchConversionPayments contract.
|
|
12
12
|
* If not provided fallback to the latest deployment address
|
|
13
13
|
* @param hre Hardhat runtime environment.
|
|
14
|
+
* @param signWithEoa Are transactions to be signed by an EAO
|
|
14
15
|
*/
|
|
15
|
-
const setupBatchConversionPayments = ({ contractAddress, hre, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const setupBatchConversionPayments = ({ contractAddress, hre, signWithEoa, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
17
|
// Setup contract parameters
|
|
17
18
|
// constants related to chainlink and conversion rate
|
|
18
19
|
const currencyManager = currency_1.CurrencyManager.getDefault();
|
|
@@ -26,14 +27,19 @@ const setupBatchConversionPayments = ({ contractAddress, hre, }) => tslib_1.__aw
|
|
|
26
27
|
const USDAddress = currencyManager.fromSymbol('USD').hash;
|
|
27
28
|
const { signer, txOverrides } = yield (0, adminTasks_1.getSignerAndGasFees)(network, hre);
|
|
28
29
|
const batchConversionPaymentConnected = batchConversionPaymentContract.connect(signer);
|
|
29
|
-
yield (0, adminTasks_1.updateBatchPaymentFees)(batchConversionPaymentConnected, txOverrides);
|
|
30
|
-
yield (0, adminTasks_1.updateBatchPaymentFeeAmountUSDLimit)(batchConversionPaymentConnected, txOverrides);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
yield (0, adminTasks_1.updateBatchPaymentFees)(batchConversionPaymentConnected, network, txOverrides, signer, signWithEoa);
|
|
31
|
+
yield (0, adminTasks_1.updateBatchPaymentFeeAmountUSDLimit)(batchConversionPaymentConnected, network, txOverrides, signer, signWithEoa);
|
|
32
|
+
const proxies = [
|
|
33
|
+
'erc20',
|
|
34
|
+
'native',
|
|
35
|
+
'erc20Conversion',
|
|
36
|
+
'nativeConversion',
|
|
37
|
+
'chainlinkConversionPath',
|
|
38
|
+
];
|
|
39
|
+
for (const proxy of proxies) {
|
|
40
|
+
yield (0, adminTasks_1.updateBatchConversionProxy)(batchConversionPaymentConnected, network, txOverrides, proxy, signer, signWithEoa);
|
|
41
|
+
}
|
|
42
|
+
yield (0, adminTasks_1.updateNativeAndUSDAddress)(batchConversionPaymentConnected, network, NativeAddress, USDAddress, txOverrides, signer, signWithEoa);
|
|
37
43
|
});
|
|
38
44
|
for (const network of hre.config.xdeploy.networks) {
|
|
39
45
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupBatchConversionPayments.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupBatchConversionPayments.ts"],"names":[],"mappings":";;;;AAAA,uCAAgE;AAEhE,6CAMsB;AACtB,uDAAsE;AACtE,iDAAyE;AAEzE
|
|
1
|
+
{"version":3,"file":"setupBatchConversionPayments.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupBatchConversionPayments.ts"],"names":[],"mappings":";;;;AAAA,uCAAgE;AAEhE,6CAMsB;AACtB,uDAAsE;AACtE,iDAAyE;AAEzE;;;;;;GAMG;AACI,MAAM,4BAA4B,GAAG,CAAO,EACjD,eAAe,EACf,GAAG,EACH,WAAW,GAKZ,EAAiB,EAAE;IAClB,4BAA4B;IAE5B,qDAAqD;IACrD,MAAM,eAAe,GAAG,0BAAe,CAAC,UAAU,EAAE,CAAC;IAErD,MAAM,YAAY,GAAG,CAAO,OAAmC,EAAE,EAAE;QACjE,OAAO,CAAC,GAAG,CAAC,oCAAoC,OAAO,EAAE,CAAC,CAAC;QAE3D,IAAI,CAAC,eAAe,EAAE;YACpB,eAAe,GAAG,qCAA+B,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACvE;QACD,MAAM,8BAA8B,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAC5D,eAAe,EACf,qCAA+B,CAAC,cAAc,EAAE,CACjD,CAAC;QAEF,MAAM,aAAa,GAAG,eAAe,CAAC,iBAAiB,CACrD,yBAAiB,CAAC,QAAQ,CAAC,GAAG,EAC9B,OAAO,CACP,CAAC,IAAI,CAAC;QACR,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC,KAAK,CAAE,CAAC,IAAI,CAAC;QAE3D,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,gCAAmB,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACxE,MAAM,+BAA+B,GAAG,8BAA8B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvF,MAAM,IAAA,mCAAsB,EAC1B,+BAA+B,EAC/B,OAAO,EACP,WAAW,EACX,MAAM,EACN,WAAW,CACZ,CAAC;QACF,MAAM,IAAA,gDAAmC,EACvC,+BAA+B,EAC/B,OAAO,EACP,WAAW,EACX,MAAM,EACN,WAAW,CACZ,CAAC;QACF,MAAM,OAAO,GAAG;YACd,OAAO;YACP,QAAQ;YACR,iBAAiB;YACjB,kBAAkB;YAClB,yBAAyB;SAC1B,CAAC;QACF,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;YAC3B,MAAM,IAAA,uCAA0B,EAC9B,+BAA+B,EAC/B,OAAO,EACP,WAAW,EACX,KAAK,EACL,MAAM,EACN,WAAW,CACZ,CAAC;SACH;QACD,MAAM,IAAA,sCAAyB,EAC7B,+BAA+B,EAC/B,OAAO,EACP,aAAa,EACb,UAAU,EACV,WAAW,EACX,MAAM,EACN,WAAW,CACZ,CAAC;IACJ,CAAC,CAAA,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE;QACjD,IAAI;YACF,oBAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YACxC,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,4DAA4D,OAAO,EAAE,CAAC,CAAC;YACpF,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;AAClE,CAAC,CAAA,CAAC;AApFW,QAAA,4BAA4B,gCAoFvC"}
|
|
@@ -4,9 +4,11 @@ import { HardhatRuntimeEnvironmentExtended } from '../types';
|
|
|
4
4
|
* @param contractAddress address of the ChainlinkConversionPath contract
|
|
5
5
|
* If not provided fallback to the latest deployment address
|
|
6
6
|
* @param hre Hardhat runtime environment
|
|
7
|
+
* @param signWithEoa Are transactions to be signed by an EAO
|
|
7
8
|
*/
|
|
8
|
-
export declare const setupChainlinkConversionPath: ({ contractAddress, hre, }: {
|
|
9
|
+
export declare const setupChainlinkConversionPath: ({ contractAddress, hre, signWithEoa, }: {
|
|
9
10
|
contractAddress?: string | undefined;
|
|
10
11
|
hre: HardhatRuntimeEnvironmentExtended;
|
|
12
|
+
signWithEoa: boolean;
|
|
11
13
|
}) => Promise<void>;
|
|
12
14
|
//# sourceMappingURL=setupChainlinkConversionPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupChainlinkConversionPath.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupChainlinkConversionPath.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAG7D
|
|
1
|
+
{"version":3,"file":"setupChainlinkConversionPath.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupChainlinkConversionPath.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAG7D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;SAMlC,iCAAiC;iBACzB,OAAO;MAClB,QAAQ,IAAI,CAsCf,CAAC"}
|
|
@@ -11,8 +11,9 @@ const adminTasks_1 = require("./adminTasks");
|
|
|
11
11
|
* @param contractAddress address of the ChainlinkConversionPath contract
|
|
12
12
|
* If not provided fallback to the latest deployment address
|
|
13
13
|
* @param hre Hardhat runtime environment
|
|
14
|
+
* @param signWithEoa Are transactions to be signed by an EAO
|
|
14
15
|
*/
|
|
15
|
-
const setupChainlinkConversionPath = ({ contractAddress, hre, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const setupChainlinkConversionPath = ({ contractAddress, hre, signWithEoa, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
17
|
// Setup contract parameters
|
|
17
18
|
yield Promise.all(hre.config.xdeploy.networks.map((network) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
19
|
var _a;
|
|
@@ -28,7 +29,7 @@ const setupChainlinkConversionPath = ({ contractAddress, hre, }) => tslib_1.__aw
|
|
|
28
29
|
throw new Error(`Could not guess native token hash for network ${network}`);
|
|
29
30
|
}
|
|
30
31
|
const ChainlinkConversionPathConnected = ChainlinkConversionPathContract.connect(signer);
|
|
31
|
-
yield (0, adminTasks_1.updateNativeTokenHash)('ChainlinkConversionPath', ChainlinkConversionPathConnected, nativeTokenHash, txOverrides);
|
|
32
|
+
yield (0, adminTasks_1.updateNativeTokenHash)('ChainlinkConversionPath', ChainlinkConversionPathConnected, network, nativeTokenHash, txOverrides, signer, signWithEoa);
|
|
32
33
|
console.log(`Setup of ChainlinkConversionPath successful on ${network}`);
|
|
33
34
|
}
|
|
34
35
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupChainlinkConversionPath.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupChainlinkConversionPath.ts"],"names":[],"mappings":";;;;AAAA,uDAAsE;AACtE,iDAA0D;AAC1D,uCAAwD;AAExD,6CAA0E;AAE1E
|
|
1
|
+
{"version":3,"file":"setupChainlinkConversionPath.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupChainlinkConversionPath.ts"],"names":[],"mappings":";;;;AAAA,uDAAsE;AACtE,iDAA0D;AAC1D,uCAAwD;AAExD,6CAA0E;AAE1E;;;;;;GAMG;AACI,MAAM,4BAA4B,GAAG,CAAO,EACjD,eAAe,EACf,GAAG,EACH,WAAW,GAKZ,EAAiB,EAAE;IAClB,4BAA4B;IAC5B,MAAM,OAAO,CAAC,GAAG,CACf,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAO,OAAe,EAAE,EAAE;;QACxD,IAAI;YACF,oBAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,eAAe,EAAE;gBACpB,eAAe,GAAG,6BAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;aAC/D;YACD,MAAM,+BAA+B,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAC7D,eAAe,EACf,6BAAuB,CAAC,cAAc,EAAE,CACzC,CAAC;YACF,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,gCAAmB,EAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YACxE,MAAM,eAAe,GAAG,MAAA,0BAAe,CAAC,UAAU,EAAE,CAAC,iBAAiB,CACpE,yBAAiB,CAAC,QAAQ,CAAC,GAAG,EAC9B,OAAO,CACR,0CAAE,IAAI,CAAC;YACR,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,iDAAiD,OAAO,EAAE,CAAC,CAAC;aAC7E;YACD,MAAM,gCAAgC,GAAG,+BAA+B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACzF,MAAM,IAAA,kCAAqB,EACzB,yBAAyB,EACzB,gCAAgC,EAChC,OAAO,EACP,eAAe,EACf,WAAW,EACX,MAAM,EACN,WAAW,CACZ,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,kDAAkD,OAAO,EAAE,CAAC,CAAC;SAC1E;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,oEAAoE,OAAO,EAAE,CAAC,CAAC;YAC5F,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;IACH,CAAC,CAAA,CAAC,CACH,CAAC;AACJ,CAAC,CAAA,CAAC;AA9CW,QAAA,4BAA4B,gCA8CvC"}
|
|
@@ -4,9 +4,11 @@ import { HardhatRuntimeEnvironmentExtended } from '../types';
|
|
|
4
4
|
* @param contractAddress address of the ERC20SwapToConversion contract
|
|
5
5
|
* If not provided fallback to the latest deployment address
|
|
6
6
|
* @param hre Hardhat runtime environment
|
|
7
|
+
* @param signWithEoa Are transactions to be signed by an EAO
|
|
7
8
|
*/
|
|
8
|
-
export declare const setupERC20SwapToConversion: ({ contractAddress, hre, }: {
|
|
9
|
+
export declare const setupERC20SwapToConversion: ({ contractAddress, hre, signWithEoa, }: {
|
|
9
10
|
contractAddress?: string | undefined;
|
|
10
11
|
hre: HardhatRuntimeEnvironmentExtended;
|
|
12
|
+
signWithEoa: boolean;
|
|
11
13
|
}) => Promise<void>;
|
|
12
14
|
//# sourceMappingURL=setupERC20SwapToConversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupERC20SwapToConversion.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupERC20SwapToConversion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAS7D
|
|
1
|
+
{"version":3,"file":"setupERC20SwapToConversion.d.ts","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupERC20SwapToConversion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAS7D;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B;;SAMhC,iCAAiC;iBACzB,OAAO;MAClB,QAAQ,IAAI,CA2Cf,CAAC"}
|
|
@@ -10,8 +10,9 @@ const currency_1 = require("@requestnetwork/currency");
|
|
|
10
10
|
* @param contractAddress address of the ERC20SwapToConversion contract
|
|
11
11
|
* If not provided fallback to the latest deployment address
|
|
12
12
|
* @param hre Hardhat runtime environment
|
|
13
|
+
* @param signWithEoa Are transactions to be signed by an EAO
|
|
13
14
|
*/
|
|
14
|
-
const setupERC20SwapToConversion = ({ contractAddress, hre, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const setupERC20SwapToConversion = ({ contractAddress, hre, signWithEoa, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
15
16
|
yield Promise.all(hre.config.xdeploy.networks.map((network) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
17
|
try {
|
|
17
18
|
currency_1.EvmChains.assertChainSupported(network);
|
|
@@ -21,9 +22,9 @@ const setupERC20SwapToConversion = ({ contractAddress, hre, }) => tslib_1.__awai
|
|
|
21
22
|
const ERC20SwapToConversionContract = new hre.ethers.Contract(contractAddress, lib_1.erc20SwapConversionArtifact.getContractAbi());
|
|
22
23
|
const { signer, txOverrides } = yield (0, adminTasks_1.getSignerAndGasFees)(network, hre);
|
|
23
24
|
const ERC20SwapToConversionConnected = yield ERC20SwapToConversionContract.connect(signer);
|
|
24
|
-
yield (0, adminTasks_1.updateChainlinkConversionPath)(ERC20SwapToConversionConnected, network, txOverrides);
|
|
25
|
-
yield (0, adminTasks_1.updateSwapRouter)(ERC20SwapToConversionConnected, network, txOverrides);
|
|
26
|
-
yield (0, adminTasks_1.updateRequestSwapFees)(ERC20SwapToConversionConnected, txOverrides);
|
|
25
|
+
yield (0, adminTasks_1.updateChainlinkConversionPath)(ERC20SwapToConversionConnected, network, txOverrides, signer, signWithEoa);
|
|
26
|
+
yield (0, adminTasks_1.updateSwapRouter)(ERC20SwapToConversionConnected, network, txOverrides, signer, signWithEoa);
|
|
27
|
+
yield (0, adminTasks_1.updateRequestSwapFees)(ERC20SwapToConversionConnected, network, txOverrides, signer, signWithEoa);
|
|
27
28
|
console.log(`Setup of Erc20SwapToConversion successful on ${network}`);
|
|
28
29
|
}
|
|
29
30
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupERC20SwapToConversion.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupERC20SwapToConversion.ts"],"names":[],"mappings":";;;;AAAA,uCAA4D;AAE5D,6CAKsB;AACtB,uDAAqD;AAErD
|
|
1
|
+
{"version":3,"file":"setupERC20SwapToConversion.js","sourceRoot":"","sources":["../../../scripts-create2/contract-setup/setupERC20SwapToConversion.ts"],"names":[],"mappings":";;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