Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
6c5c3195
Commit
6c5c3195
authored
Jun 17, 2021
by
elenadimitrova
Committed by
Elena Gesheva
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow 0 address for l1 token when creating l2 standard token
parent
8708ef22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
OVM_L2StandardTokenFactory.sol
...ethereum/OVM/bridge/tokens/OVM_L2StandardTokenFactory.sol
+2
-0
OVM_L2StandardTokenFactory.spec.ts
...acts/OVM/bridge/assets/OVM_L2StandardTokenFactory.spec.ts
+8
-1
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/bridge/tokens/OVM_L2StandardTokenFactory.sol
View file @
6c5c3195
...
...
@@ -30,6 +30,8 @@ contract OVM_L2StandardTokenFactory {
)
external
{
require (_l1Token != address(0), "Must provide L1 token address");
L2StandardERC20 l2Token = new L2StandardERC20(
Lib_PredeployAddresses.L2_STANDARD_BRIDGE,
_l1Token,
...
...
packages/contracts/test/contracts/OVM/bridge/assets/OVM_L2StandardTokenFactory.spec.ts
View file @
6c5c3195
...
...
@@ -7,7 +7,6 @@ import { smoddit } from '@eth-optimism/smock'
import
{
getContractInterface
}
from
'
@eth-optimism/contracts
'
/* Internal Imports */
import
{
NON_NULL_BYTES32
,
NON_ZERO_ADDRESS
}
from
'
../../../../helpers
'
import
{
predeploys
}
from
'
../../../../../src
'
describe
(
'
OVM_L2StandardTokenFactory
'
,
()
=>
{
...
...
@@ -54,5 +53,13 @@ describe('OVM_L2StandardTokenFactory', () => {
expect
(
await
l2Token
.
name
()).
to
.
equal
(
'
L2ERC20
'
)
expect
(
await
l2Token
.
symbol
()).
to
.
equal
(
'
ERC
'
)
})
it
(
'
should not be able to create a standard token with a 0 address for l1 token
'
,
async
()
=>
{
await
expect
(
OVM_L2StandardTokenFactory
.
createStandardL2Token
(
ethers
.
constants
.
AddressZero
,
'
L2ERC20
'
,
'
ERC
'
)).
to
.
be
.
revertedWith
(
'
Must provide L1 token address
'
)
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment