implement the code size opcodes (#107)

This commit is contained in:
Cyrill Leutwiler
2024-10-31 11:46:47 +01:00
committed by GitHub
parent 68564f9866
commit 43d2ef3ce9
6 changed files with 484 additions and 418 deletions
+3 -5
View File
@@ -105,9 +105,7 @@ contract ERC20Tester {
ERC20 token = new ERC20();
assert(token.decimals() == 18);
// use call directly when code_size is implemented on pallet-revive
address(token).call(abi.encodeWithSignature("mint(uint256)", 300));
token.mint(300);
assert(token.balanceOf(address(this)) == 300);
token.transfer(BOB, 100);
assert(token.balanceOf(address(this)) == 200);
@@ -119,7 +117,7 @@ contract ERC20Tester {
assert(token.balanceOf(BOB) == 200);
assert(token.balanceOf(address(this)) == 100);
address(token).call(abi.encodeWithSignature("burn(uint256)", 100));
token.burn(100);
assert(token.balanceOf(address(this)) == 0);
}
}
}