Skip to content

Commit 7c90b43

Browse files
godzillabagzeoneth
andauthored
Add missing nativeToken property to local network (#110)
* add missing nativeToken property to local network * do not scale fee amount in test since sdk now handles * chore: bump version to 1.2.5 --------- Co-authored-by: gzeon <[email protected]>
1 parent 9283970 commit 7c90b43

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@arbitrum/token-bridge-contracts",
3-
"version": "1.2.4",
3+
"version": "1.2.5",
44
"license": "Apache-2.0",
55
"scripts": {
66
"prepublishOnly": "hardhat clean && hardhat compile",

scripts/local-deployment/localDeploymentLib.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from '../atomicTokenBridgeDeployer'
1313
import {
1414
ERC20__factory,
15+
IERC20Bridge__factory,
1516
IOwnable__factory,
1617
TestWETH9__factory,
1718
} from '../../build/types'
@@ -240,7 +241,14 @@ export const getLocalNetwork = async (
240241
const bridge = Bridge__factory.connect(data.bridge, l1Provider)
241242
const outboxAddr = await bridge.allowedOutboxList(0)
242243

244+
let nativeToken: string | undefined = undefined
245+
try {
246+
nativeToken = await IERC20Bridge__factory.connect(data.bridge, l1Provider).nativeToken()
247+
}
248+
catch {}
249+
243250
const l2Network: ArbitrumNetwork = {
251+
nativeToken,
244252
parentChainId: l1NetworkInfo.chainId,
245253
chainId: l2NetworkInfo.chainId,
246254
confirmPeriodBlocks: 20,

test-e2e/orbitTokenBridge.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -479,20 +479,8 @@ describe('orbitTokenBridge', () => {
479479
)
480480

481481
// approve fee amount
482-
const valueForGateway = nativeToken
483-
? await _getScaledAmount(
484-
nativeToken.address,
485-
gwRetryableParams.deposit,
486-
nativeToken.provider!
487-
)
488-
: gwRetryableParams.deposit
489-
const valueForRouter = nativeToken
490-
? await _getScaledAmount(
491-
nativeToken.address,
492-
routerRetryableParams.deposit,
493-
nativeToken.provider!
494-
)
495-
: routerRetryableParams.deposit
482+
const valueForGateway = gwRetryableParams.deposit
483+
const valueForRouter = routerRetryableParams.deposit
496484
const registrationFee = valueForGateway.add(valueForRouter).mul(2)
497485
if (nativeToken) {
498486
await (

0 commit comments

Comments
 (0)