Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cmp20test
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
explorer-for-cmp20
cmp20test
Commits
f89e27c4
Commit
f89e27c4
authored
Dec 16, 2025
by
Developer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test
parent
8263bce8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
27 deletions
+14
-27
mcopy-evm.test.js
test/mcopy-evm.test.js
+6
-9
prague-evm.test.js
test/prague-evm.test.js
+8
-18
No files found.
test/mcopy-evm.test.js
View file @
f89e27c4
const
{
loadFixture
,
}
=
require
(
"
@nomicfoundation/hardhat-toolbox/network-helpers
"
);
const
{
expect
}
=
require
(
"
chai
"
);
describe
(
"
TestMCOPY
"
,
function
()
{
async
function
deployTestMCOPYFixture
()
{
let
testMCOPY
;
beforeEach
(
async
function
()
{
const
TestMCOPY
=
await
ethers
.
getContractFactory
(
"
TestMCOPY
"
);
const
testMCOPY
=
await
TestMCOPY
.
deploy
();
return
{
testMCOPY
}
;
}
testMCOPY
=
await
TestMCOPY
.
deploy
();
await
testMCOPY
.
waitForDeployment
()
;
}
);
describe
(
"
Deployment
"
,
function
()
{
it
(
"
Should deploy successfully
"
,
async
function
()
{
const
{
testMCOPY
}
=
await
loadFixture
(
deployTestMCOPYFixture
);
expect
(
testMCOPY
.
target
).
to
.
not
.
be
.
null
;
});
});
describe
(
"
Opcodes
"
,
function
()
{
it
(
"
Should correctly perform mcopy
"
,
async
function
()
{
const
{
testMCOPY
}
=
await
loadFixture
(
deployTestMCOPYFixture
);
const
result
=
await
testMCOPY
.
testExplicitMCopy
();
expect
(
result
).
to
.
equal
(
"
0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
"
);
});
...
...
test/prague-evm.test.js
View file @
f89e27c4
const
{
time
,
loadFixture
,
}
=
require
(
"
@nomicfoundation/hardhat-toolbox/network-helpers
"
);
const
{
anyValue
}
=
require
(
"
@nomicfoundation/hardhat-chai-matchers/withArgs
"
);
const
{
expect
}
=
require
(
"
chai
"
);
describe
(
"
TTest
"
,
function
()
{
async
function
deployTTestFixture
()
{
const
[
owner
,
otherAccount
]
=
await
ethers
.
getSigners
();
let
ttest
;
let
owner
;
let
otherAccount
;
beforeEach
(
async
function
()
{
[
owner
,
otherAccount
]
=
await
ethers
.
getSigners
();
const
TTest
=
await
ethers
.
getContractFactory
(
"
TTest
"
);
const
ttest
=
await
TTest
.
deploy
();
return
{
ttest
,
owner
,
otherAccount
};
}
ttest
=
await
TTest
.
deploy
();
await
ttest
.
waitForDeployment
();
});
describe
(
"
Deployment
"
,
function
()
{
it
(
"
Should deploy successfully
"
,
async
function
()
{
const
{
ttest
}
=
await
loadFixture
(
deployTTestFixture
);
expect
(
ttest
.
target
).
to
.
not
.
be
.
null
;
});
});
describe
(
"
Opcodes
"
,
function
()
{
it
(
"
Should return BASEFEE
"
,
async
function
()
{
const
{
ttest
}
=
await
loadFixture
(
deployTTestFixture
);
// In Hardhat Network, basefee is 1_000_000_000 by default after london
const
basefee
=
await
ttest
.
testBASEFEE
();
expect
(
basefee
).
to
.
be
.
gt
(
0
);
});
it
(
"
Should return PREVRANDAO
"
,
async
function
()
{
const
{
ttest
}
=
await
loadFixture
(
deployTTestFixture
);
const
prevrandao
=
await
ttest
.
testPREVRANDAO
();
expect
(
prevrandao
).
to
.
not
.
be
.
null
;
});
it
(
"
Should return BLOBHASH
"
,
async
function
()
{
const
{
ttest
}
=
await
loadFixture
(
deployTTestFixture
);
// Hardhat does not support blobs yet.
// The blobhash opcode will return 0x00...0
const
bhash
=
await
ttest
.
testBLOBHASH
();
...
...
@@ -45,7 +38,6 @@ describe("TTest", function () {
});
it
(
"
Should return BLOBFEE
"
,
async
function
()
{
const
{
ttest
}
=
await
loadFixture
(
deployTTestFixture
);
// In Hardhat Network with cancun fork, blobbasefee is 1.
const
blobfee
=
await
ttest
.
testBLOBFEE
();
expect
(
blobfee
).
to
.
equal
(
1
);
...
...
@@ -54,8 +46,6 @@ describe("TTest", function () {
describe
(
"
Reentrancy
"
,
function
()
{
it
(
"
Should prevent reentrant calls
"
,
async
function
()
{
const
{
ttest
}
=
await
loadFixture
(
deployTTestFixture
);
// To test re-entrancy, we deploy an Attacker contract
// that will try to call the `test` function again from its fallback.
const
Attacker
=
await
ethers
.
getContractFactory
(
"
Attacker
"
);
...
...
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