forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredeploys.spec.ts
117 lines (100 loc) · 3.06 KB
/
predeploys.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* Imports: External */
import { ethers } from 'ethers'
import { predeploys, getContractInterface } from '@eth-optimism/contracts'
/* Imports: Internal */
import { expect } from './shared/setup'
import { OptimismEnv } from './shared/env'
describe('predeploys', () => {
let env: OptimismEnv
before(async () => {
env = await OptimismEnv.new()
})
describe('WETH9', () => {
let weth9: ethers.Contract
before(() => {
weth9 = new ethers.Contract(
predeploys.WETH9,
getContractInterface('WETH9'),
env.l2Wallet
)
})
it('should have the correct name', async () => {
expect(await weth9.name()).to.equal('Wrapped Ether')
})
it('should have the correct symbol', async () => {
expect(await weth9.symbol()).to.equal('WETH')
})
it('should have the correct decimals', async () => {
expect(await weth9.decimals()).to.equal(18)
})
})
describe('OVM_ETH', () => {
let ovmEth: ethers.Contract
before(() => {
ovmEth = new ethers.Contract(
predeploys.OVM_ETH,
getContractInterface('OVM_ETH'),
env.l2Wallet
)
})
it('should have the correct name', async () => {
expect(await ovmEth.name()).to.equal('Ether')
})
it('should have the correct symbol', async () => {
expect(await ovmEth.symbol()).to.equal('ETH')
})
it('should have the correct decimals', async () => {
expect(await ovmEth.decimals()).to.equal(18)
})
})
describe('L2CrossDomainMessenger', () => {
let l2CrossDomainMessenger: ethers.Contract
before(() => {
l2CrossDomainMessenger = new ethers.Contract(
predeploys.L2CrossDomainMessenger,
getContractInterface('L2CrossDomainMessenger'),
env.l2Wallet
)
})
it('should throw when calling xDomainMessageSender', async () => {
await expect(
l2CrossDomainMessenger.xDomainMessageSender()
).to.be.revertedWith('xDomainMessageSender is not set')
})
})
describe('L2StandardBridge', () => {
let l2StandardBridge: ethers.Contract
before(() => {
l2StandardBridge = new ethers.Contract(
predeploys.L2StandardBridge,
getContractInterface('L2StandardBridge'),
env.l2Wallet
)
})
it('should have the correct messenger address', async () => {
expect(await l2StandardBridge.messenger()).to.equal(
predeploys.L2CrossDomainMessenger
)
})
it('should have a nonzero bridge address', async () => {
expect(await l2StandardBridge.l1TokenBridge()).to.not.equal(
ethers.constants.AddressZero
)
})
})
describe('OVM_SequencerFeeVault', () => {
let ovmSequencerFeeVault: ethers.Contract
before(() => {
ovmSequencerFeeVault = new ethers.Contract(
predeploys.OVM_SequencerFeeVault,
getContractInterface('OVM_SequencerFeeVault'),
env.l2Wallet
)
})
it('should have a nonzero l1FeeWallet', async () => {
expect(await ovmSequencerFeeVault.l1FeeWallet()).to.not.equal(
ethers.constants.AddressZero
)
})
})
})