Commit 897f64da authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: port assert receiver + transactor

parent b707310c
AssetReceiverTest:testFail_withdrawERC20() (gas: 196806)
AssetReceiverTest:testFail_withdrawERC20withAmount() (gas: 196820)
AssetReceiverTest:testFail_withdrawERC721() (gas: 55506)
AssetReceiverTest:testFail_withdrawETH() (gas: 10297)
AssetReceiverTest:testFail_withdrawETHwithAmount() (gas: 10369)
AssetReceiverTest:test_constructor() (gas: 9694)
AssetReceiverTest:test_receive() (gas: 20824)
AssetReceiverTest:test_withdrawERC20() (gas: 183383)
AssetReceiverTest:test_withdrawERC20withAmount() (gas: 182514)
AssetReceiverTest:test_withdrawERC721() (gas: 50773)
AssetReceiverTest:test_withdrawETH() (gas: 28300)
AssetReceiverTest:test_withdrawETHwithAmount() (gas: 28263)
Bytes_slice_Test:test_slice_acrossMultipleWords_works() (gas: 9413) Bytes_slice_Test:test_slice_acrossMultipleWords_works() (gas: 9413)
Bytes_slice_Test:test_slice_acrossWords_works() (gas: 1430) Bytes_slice_Test:test_slice_acrossWords_works() (gas: 1430)
Bytes_slice_Test:test_slice_fromNonZeroIdx_works() (gas: 17240) Bytes_slice_Test:test_slice_fromNonZeroIdx_works() (gas: 17240)
...@@ -463,5 +475,10 @@ SystemConfig_Setters_TestFail:test_setResourceConfig_lowGasLimit_reverts() (gas: ...@@ -463,5 +475,10 @@ SystemConfig_Setters_TestFail:test_setResourceConfig_lowGasLimit_reverts() (gas:
SystemConfig_Setters_TestFail:test_setResourceConfig_notOwner_reverts() (gas: 11790) SystemConfig_Setters_TestFail:test_setResourceConfig_notOwner_reverts() (gas: 11790)
SystemConfig_Setters_TestFail:test_setResourceConfig_zeroDenominator_reverts() (gas: 13039) SystemConfig_Setters_TestFail:test_setResourceConfig_zeroDenominator_reverts() (gas: 13039)
SystemConfig_Setters_TestFail:test_setUnsafeBlockSigner_notOwner_reverts() (gas: 10616) SystemConfig_Setters_TestFail:test_setUnsafeBlockSigner_notOwner_reverts() (gas: 10616)
TransactorTest:testFail_CALL() (gas: 15453)
TransactorTest:testFail_DELEGATECALLL() (gas: 15494)
TransactorTest:test_CALL() (gas: 26776)
TransactorTest:test_DELEGATECALL() (gas: 20909)
TransactorTest:test_constructor() (gas: 9716)
TransferOnionTest:test_constructor_succeeds() (gas: 564855) TransferOnionTest:test_constructor_succeeds() (gas: 564855)
TransferOnionTest:test_unwrap_succeeds() (gas: 724955) TransferOnionTest:test_unwrap_succeeds() (gas: 724955)
\ No newline at end of file
...@@ -3,9 +3,9 @@ pragma solidity 0.8.15; ...@@ -3,9 +3,9 @@ pragma solidity 0.8.15;
/* Testing utilities */ /* Testing utilities */
import { Test } from "forge-std/Test.sol"; import { Test } from "forge-std/Test.sol";
import { TestERC20 } from "../testing/helpers/TestERC20.sol"; import { TestERC20 } from "./Helpers.sol";
import { TestERC721 } from "../testing/helpers/TestERC721.sol"; import { TestERC721 } from "./Helpers.sol";
import { AssetReceiver } from "../universal/AssetReceiver.sol"; import { AssetReceiver } from "../periphery/AssetReceiver.sol";
contract AssetReceiver_Initializer is Test { contract AssetReceiver_Initializer is Test {
address alice = address(128); address alice = address(128);
......
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ERC20 } from "@rari-capital/solmate/src/tokens/ERC20.sol";
import { ERC721 } from "@rari-capital/solmate/src/tokens/ERC721.sol";
contract TestERC20 is ERC20 {
constructor() ERC20("TEST", "TST", 18) {}
function mint(address to, uint256 value) public {
_mint(to, value);
}
}
contract TestERC721 is ERC721 {
constructor() ERC721("TEST", "TST") {}
function mint(address to, uint256 tokenId) public {
_mint(to, tokenId);
}
function tokenURI(uint256) public pure virtual override returns (string memory) {}
}
contract CallRecorder {
struct CallInfo {
address sender;
bytes data;
uint256 gas;
uint256 value;
}
CallInfo public lastCall;
function record() public payable {
lastCall.sender = msg.sender;
lastCall.data = msg.data;
lastCall.gas = gasleft();
lastCall.value = msg.value;
}
}
contract Reverter {
function doRevert() public pure {
revert("Reverter reverted");
}
}
...@@ -3,9 +3,9 @@ pragma solidity 0.8.15; ...@@ -3,9 +3,9 @@ pragma solidity 0.8.15;
/* Testing utilities */ /* Testing utilities */
import { Test } from "forge-std/Test.sol"; import { Test } from "forge-std/Test.sol";
import { CallRecorder } from "../testing/helpers/CallRecorder.sol"; import { CallRecorder } from "./Helpers.sol";
import { Reverter } from "../testing/helpers/Reverter.sol"; import { Reverter } from "./Helpers.sol";
import { Transactor } from "../universal/Transactor.sol"; import { Transactor } from "../periphery/Transactor.sol";
contract Transactor_Initializer is Test { contract Transactor_Initializer is Test {
address alice = address(128); address alice = address(128);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment