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
f20e9a12
Unverified
Commit
f20e9a12
authored
Sep 13, 2021
by
elenadimitrova
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove erc20.spec.ts integration tests
parent
199e895e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
83 deletions
+0
-83
erc20.spec.ts
integration-tests/test/erc20.spec.ts
+0
-83
No files found.
integration-tests/test/erc20.spec.ts
deleted
100644 → 0
View file @
199e895e
import
{
Contract
,
ContractFactory
,
Wallet
}
from
'
ethers
'
import
{
ethers
}
from
'
hardhat
'
import
{
TxGasLimit
,
TxGasPrice
}
from
'
@eth-optimism/core-utils
'
import
chai
,
{
expect
}
from
'
chai
'
import
{
GWEI
}
from
'
./shared/utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
solidity
}
from
'
ethereum-waffle
'
chai
.
use
(
solidity
)
describe
(
'
Basic ERC20 interactions
'
,
async
()
=>
{
const
initialAmount
=
1000
const
tokenName
=
'
OVM Test
'
const
tokenDecimals
=
8
const
TokenSymbol
=
'
OVM
'
let
wallet
:
Wallet
let
other
:
Wallet
let
Factory__ERC20
:
ContractFactory
let
ERC20
:
Contract
before
(
async
()
=>
{
const
env
=
await
OptimismEnv
.
new
()
wallet
=
env
.
l2Wallet
other
=
Wallet
.
createRandom
().
connect
(
ethers
.
provider
)
Factory__ERC20
=
await
ethers
.
getContractFactory
(
'
ERC20
'
,
wallet
)
})
beforeEach
(
async
()
=>
{
ERC20
=
await
Factory__ERC20
.
deploy
(
initialAmount
,
tokenName
,
tokenDecimals
,
TokenSymbol
)
})
it
(
'
should set the total supply
'
,
async
()
=>
{
const
totalSupply
=
await
ERC20
.
totalSupply
()
expect
(
totalSupply
.
toNumber
()).
to
.
equal
(
initialAmount
)
})
it
(
'
should get the token name
'
,
async
()
=>
{
const
name
=
await
ERC20
.
name
()
expect
(
name
).
to
.
equal
(
tokenName
)
})
it
(
'
should get the token decimals
'
,
async
()
=>
{
const
decimals
=
await
ERC20
.
decimals
()
expect
(
decimals
).
to
.
equal
(
tokenDecimals
)
})
it
(
'
should get the token symbol
'
,
async
()
=>
{
const
symbol
=
await
ERC20
.
symbol
()
expect
(
symbol
).
to
.
equal
(
TokenSymbol
)
})
it
(
'
should assign initial balance
'
,
async
()
=>
{
const
balance
=
await
ERC20
.
balanceOf
(
wallet
.
address
)
expect
(
balance
.
toNumber
()).
to
.
equal
(
initialAmount
)
})
it
(
'
should transfer amount to destination account
'
,
async
()
=>
{
const
transfer
=
await
ERC20
.
transfer
(
other
.
address
,
100
)
const
receipt
=
await
transfer
.
wait
()
expect
(
receipt
.
events
.
length
).
to
.
equal
(
1
)
expect
(
receipt
.
events
[
0
].
args
.
_from
).
to
.
equal
(
wallet
.
address
)
expect
(
receipt
.
events
[
0
].
args
.
_value
.
toNumber
()).
to
.
equal
(
100
)
const
receiverBalance
=
await
ERC20
.
balanceOf
(
other
.
address
)
const
senderBalance
=
await
ERC20
.
balanceOf
(
wallet
.
address
)
expect
(
receiverBalance
.
toNumber
()).
to
.
equal
(
100
)
expect
(
senderBalance
.
toNumber
()).
to
.
equal
(
900
)
})
it
(
'
should revert if trying to transfer too much
'
,
async
()
=>
{
await
expect
(
ERC20
.
transfer
(
other
.
address
,
initialAmount
*
2
)
).
to
.
be
.
revertedWith
(
'
insufficient balance
'
)
})
})
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