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
60506d83
Commit
60506d83
authored
Jun 30, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctb: fixup for gas snapshot
parent
600d3d42
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
76 deletions
+76
-76
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+69
-69
AssetReceiver.t.sol
...ages/contracts-bedrock/contracts/test/AssetReceiver.t.sol
+5
-5
Transactor.t.sol
packages/contracts-bedrock/contracts/test/Transactor.t.sol
+2
-2
No files found.
packages/contracts-bedrock/.gas-snapshot
View file @
60506d83
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/contracts/test/AssetReceiver.t.sol
View file @
60506d83
...
@@ -99,8 +99,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
...
@@ -99,8 +99,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
// withdrawETH should fail if called by non-owner
// withdrawETH should fail if called by non-owner
function test_withdrawETH_unauthorized_reverts() external {
function test_withdrawETH_unauthorized_reverts() external {
vm.deal(address(assetReceiver), 1 ether);
vm.deal(address(assetReceiver), 1 ether);
assetReceiver.withdrawETH(payable(alice));
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
assetReceiver.withdrawETH(payable(alice));
}
}
// Similar as withdrawETH but specify amount to withdraw
// Similar as withdrawETH but specify amount to withdraw
...
@@ -127,8 +127,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
...
@@ -127,8 +127,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
// withdrawETH with address and amount as arguments called by non-owner
// withdrawETH with address and amount as arguments called by non-owner
function test_withdrawETHwithAmount_unauthorized_reverts() external {
function test_withdrawETHwithAmount_unauthorized_reverts() external {
vm.deal(address(assetReceiver), 1 ether);
vm.deal(address(assetReceiver), 1 ether);
assetReceiver.withdrawETH(payable(alice), 0.5 ether);
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
assetReceiver.withdrawETH(payable(alice), 0.5 ether);
}
}
// Test withdrawERC20 with token and address arguments, from owner
// Test withdrawERC20 with token and address arguments, from owner
...
@@ -155,8 +155,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
...
@@ -155,8 +155,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
// Same as withdrawERC20 but call from non-owner
// Same as withdrawERC20 but call from non-owner
function test_withdrawERC20_unauthorized_reverts() external {
function test_withdrawERC20_unauthorized_reverts() external {
deal(address(testERC20), address(assetReceiver), 100_000);
deal(address(testERC20), address(assetReceiver), 100_000);
assetReceiver.withdrawERC20(testERC20, alice);
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
assetReceiver.withdrawERC20(testERC20, alice);
}
}
// Similar as withdrawERC20 but specify amount to withdraw
// Similar as withdrawERC20 but specify amount to withdraw
...
@@ -183,8 +183,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
...
@@ -183,8 +183,8 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
// Similar as withdrawERC20 with amount but call from non-owner
// Similar as withdrawERC20 with amount but call from non-owner
function test_withdrawERC20withAmount_unauthorized_reverts() external {
function test_withdrawERC20withAmount_unauthorized_reverts() external {
deal(address(testERC20), address(assetReceiver), 100_000);
deal(address(testERC20), address(assetReceiver), 100_000);
assetReceiver.withdrawERC20(testERC20, alice, 50_000);
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
assetReceiver.withdrawERC20(testERC20, alice, 50_000);
}
}
// Test withdrawERC721 from owner
// Test withdrawERC721 from owner
...
@@ -212,7 +212,7 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
...
@@ -212,7 +212,7 @@ contract AssetReceiverTest is AssetReceiver_Initializer {
function test_withdrawERC721_unauthorized_reverts() external {
function test_withdrawERC721_unauthorized_reverts() external {
vm.prank(alice);
vm.prank(alice);
testERC721.transferFrom(alice, address(assetReceiver), DEFAULT_TOKEN_ID);
testERC721.transferFrom(alice, address(assetReceiver), DEFAULT_TOKEN_ID);
assetReceiver.withdrawERC721(testERC721, alice, DEFAULT_TOKEN_ID);
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
assetReceiver.withdrawERC721(testERC721, alice, DEFAULT_TOKEN_ID);
}
}
}
}
packages/contracts-bedrock/contracts/test/Transactor.t.sol
View file @
60506d83
...
@@ -55,8 +55,8 @@ contract TransactorTest is Transactor_Initializer {
...
@@ -55,8 +55,8 @@ contract TransactorTest is Transactor_Initializer {
bytes memory data = abi.encodeWithSelector(callRecorded.record.selector);
bytes memory data = abi.encodeWithSelector(callRecorded.record.selector);
// Run CALL
// Run CALL
vm.prank(bob);
vm.prank(bob);
transactor.CALL(address(callRecorded), data, 200_000 wei);
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
transactor.CALL(address(callRecorded), data, 200_000 wei);
}
}
function test_delegateCall_succeeds() external {
function test_delegateCall_succeeds() external {
...
@@ -74,7 +74,7 @@ contract TransactorTest is Transactor_Initializer {
...
@@ -74,7 +74,7 @@ contract TransactorTest is Transactor_Initializer {
bytes memory data = abi.encodeWithSelector(reverter.doRevert.selector);
bytes memory data = abi.encodeWithSelector(reverter.doRevert.selector);
// Run CALL
// Run CALL
vm.prank(bob);
vm.prank(bob);
transactor.DELEGATECALL(address(reverter), data);
vm.expectRevert("UNAUTHORIZED");
vm.expectRevert("UNAUTHORIZED");
transactor.DELEGATECALL(address(reverter), data);
}
}
}
}
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