diff --git a/README.md b/README.md index cd7f95f86e..16bbc282ed 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ I'm sooooooOooooooooOoooOoooooooooooooooo... ## Installation -To install with [**Foundry**](https://github.com/gakonst/foundry): +To install with [**Foundry**](https://github.com/foundry-rs/foundry): ```sh forge install vectorized/solady diff --git a/foundry.toml b/foundry.toml index 607d6263fd..a7772ef1e9 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,6 +1,6 @@ # Foundry Configuration File -# Default definitions: https://github.com/gakonst/foundry/blob/b7917fa8491aedda4dd6db53fbb206ea233cd531/config/src/lib.rs#L782 -# See more config options at: https://github.com/gakonst/foundry/tree/master/config +# Default definitions: https://github.com/foundry-rs/foundry/blob/b7917fa8491aedda4dd6db53fbb206ea233cd531/config/src/lib.rs#L782 +# See more config options at: https://github.com/foundry-rs/foundry/tree/master/.config # The Default Profile [profile.default] diff --git a/package.json b/package.json index 36ecb9e251..f93a68442f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "solady", "license": "MIT", - "version": "0.0.270", + "version": "0.0.271", "description": "Optimized Solidity snippets.", "files": [ "src/**/*.sol", diff --git a/test/ERC7821.t.sol b/test/ERC7821.t.sol index 06b949bdb1..2402914ff4 100644 --- a/test/ERC7821.t.sol +++ b/test/ERC7821.t.sol @@ -12,8 +12,6 @@ contract ERC7821Test is SoladyTest { address target; - bytes32 internal constant _SUPPORTED_MODE = bytes10(0x01000000000078210001); - function setUp() public { mbe = new MockERC7821(); target = LibClone.clone(address(this)); @@ -31,34 +29,7 @@ contract ERC7821Test is SoladyTest { return keccak256(b); } - function testERC7821Gas() public { - vm.pauseGasMetering(); - vm.deal(address(this), 1 ether); - - ERC7821.Call[] memory calls = new ERC7821.Call[](2); - - calls[0].target = target; - calls[0].value = 123; - calls[0].data = abi.encodeWithSignature("returnsBytes(bytes)", "hehe"); - - calls[1].target = target; - calls[1].value = 789; - calls[1].data = abi.encodeWithSignature("returnsHash(bytes)", "lol"); - - bytes memory data = abi.encode(calls); - vm.resumeGasMetering(); - - bytes[] memory results = mbe.execute{value: _totalValue(calls)}(_SUPPORTED_MODE, data); - - vm.pauseGasMetering(); - - assertEq(results.length, 2); - assertEq(abi.decode(results[0], (bytes)), "hehe"); - assertEq(abi.decode(results[1], (bytes32)), keccak256("lol")); - vm.resumeGasMetering(); - } - - function testERC7821(bytes memory opData) public { + function testERC7821() public { vm.deal(address(this), 1 ether); ERC7821.Call[] memory calls = new ERC7821.Call[](2); @@ -71,10 +42,7 @@ contract ERC7821Test is SoladyTest { calls[1].value = 789; calls[1].data = abi.encodeWithSignature("returnsHash(bytes)", "lol"); - bytes[] memory results = - mbe.execute{value: _totalValue(calls)}(_SUPPORTED_MODE, _encode(calls, opData)); - - assertEq(mbe.lastOpData(), opData); + bytes[] memory results = mbe.execute{value: _totalValue(calls)}(calls, ""); assertEq(results.length, 2); assertEq(abi.decode(results[0], (bytes)), "hehe"); @@ -88,15 +56,7 @@ contract ERC7821Test is SoladyTest { calls[0].data = abi.encodeWithSignature("revertsWithCustomError()"); vm.expectRevert(CustomError.selector); - mbe.execute{value: _totalValue(calls)}(_SUPPORTED_MODE, _encode(calls, "")); - } - - function _encode(ERC7821.Call[] memory calls, bytes memory opData) - internal - returns (bytes memory) - { - if (_randomChance(2) && opData.length == 0) return abi.encode(calls); - return abi.encode(calls, opData); + mbe.execute{value: _totalValue(calls)}(calls, ""); } struct Payload {