( signer: SignerWithAddress, tokensToAdd: Contract[], maxL1TokensPerPoolRebalanceLeaf: number = MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF, maxRefundPerRelayerRefundLeaf: number = MAX_REFUNDS_PER_RELAYER_REFUND_LEAF, rateModel: unknown = sampleRateModel, additionalChainIdIndices?: number[] )
| 135 | } |
| 136 | |
| 137 | export async function deployConfigStore( |
| 138 | signer: SignerWithAddress, |
| 139 | tokensToAdd: Contract[], |
| 140 | maxL1TokensPerPoolRebalanceLeaf: number = MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF, |
| 141 | maxRefundPerRelayerRefundLeaf: number = MAX_REFUNDS_PER_RELAYER_REFUND_LEAF, |
| 142 | rateModel: unknown = sampleRateModel, |
| 143 | additionalChainIdIndices?: number[] |
| 144 | ): Promise<{ configStore: AcrossConfigStore; deploymentBlock: number }> { |
| 145 | const configStore = (await ( |
| 146 | await utils.getContractFactory("AcrossConfigStore", signer) |
| 147 | ).deploy()) as AcrossConfigStore; |
| 148 | const { blockNumber: deploymentBlock } = await configStore.deployTransaction.wait(); |
| 149 | |
| 150 | for (const token of tokensToAdd) { |
| 151 | await configStore.updateTokenConfig( |
| 152 | token.address, |
| 153 | JSON.stringify({ |
| 154 | rateModel: rateModel, |
| 155 | }) |
| 156 | ); |
| 157 | } |
| 158 | await configStore.updateGlobalConfig( |
| 159 | utf8ToHex(GLOBAL_CONFIG_STORE_KEYS.MAX_POOL_REBALANCE_LEAF_SIZE), |
| 160 | maxL1TokensPerPoolRebalanceLeaf.toString() |
| 161 | ); |
| 162 | await configStore.updateGlobalConfig( |
| 163 | utf8ToHex(GLOBAL_CONFIG_STORE_KEYS.MAX_RELAYER_REPAYMENT_LEAF_SIZE), |
| 164 | maxRefundPerRelayerRefundLeaf.toString() |
| 165 | ); |
| 166 | |
| 167 | if (additionalChainIdIndices) { |
| 168 | await configStore.updateGlobalConfig( |
| 169 | utf8ToHex(GLOBAL_CONFIG_STORE_KEYS.CHAIN_ID_INDICES), |
| 170 | JSON.stringify([...constants.PROTOCOL_DEFAULT_CHAIN_ID_INDICES, ...additionalChainIdIndices]) |
| 171 | ); |
| 172 | } |
| 173 | return { configStore, deploymentBlock }; |
| 174 | } |
| 175 | |
| 176 | export async function deployAndConfigureHubPool( |
| 177 | signer: SignerWithAddress, |
no outgoing calls
no test coverage detected