Skip to content

Commit

Permalink
♻️ More EIP-713 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
transmissions11 committed Oct 12, 2022
1 parent 576a89d commit 352e1e9
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 107 deletions.
120 changes: 60 additions & 60 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
AuthTest:testCallFunctionAsOwner() (gas: 29871)
AuthTest:testCallFunctionWithPermissiveAuthority() (gas: 124249)
AuthTest:testCallFunctionWithPermissiveAuthority(address) (runs: 256, μ: 129195, ~: 129214)
AuthTest:testFailCallFunctionAsNonOwner() (gas: 15491)
AuthTest:testFailCallFunctionAsNonOwner(address) (runs: 256, μ: 15631, ~: 15631)
AuthTest:testCallFunctionAsOwner() (gas: 29784)
AuthTest:testCallFunctionWithPermissiveAuthority() (gas: 124292)
AuthTest:testCallFunctionWithPermissiveAuthority(address) (runs: 256, μ: 129216, ~: 129235)
AuthTest:testFailCallFunctionAsNonOwner() (gas: 15523)
AuthTest:testFailCallFunctionAsNonOwner(address) (runs: 256, μ: 15685, ~: 15685)
AuthTest:testFailCallFunctionAsOwnerWithOutOfOrderAuthority() (gas: 136021)
AuthTest:testFailCallFunctionWithRestrictiveAuthority() (gas: 129201)
AuthTest:testFailCallFunctionWithRestrictiveAuthority(address) (runs: 256, μ: 129319, ~: 129319)
AuthTest:testFailSetAuthorityAsNonOwner() (gas: 18260)
AuthTest:testFailSetAuthorityAsNonOwner(address,address) (runs: 256, μ: 18551, ~: 18551)
AuthTest:testFailSetAuthorityWithRestrictiveAuthority() (gas: 129078)
AuthTest:testFailSetAuthorityWithRestrictiveAuthority(address,address) (runs: 256, μ: 129410, ~: 129410)
AuthTest:testFailSetOwnerAsNonOwner() (gas: 15609)
AuthTest:testFailSetOwnerAsNonOwner(address,address) (runs: 256, μ: 15835, ~: 15835)
AuthTest:testFailSetOwnerAsOwnerWithOutOfOrderAuthority() (gas: 136161)
AuthTest:testFailSetOwnerAsOwnerWithOutOfOrderAuthority(address) (runs: 256, μ: 136323, ~: 136323)
AuthTest:testFailSetOwnerWithRestrictiveAuthority() (gas: 129242)
AuthTest:testFailSetOwnerWithRestrictiveAuthority(address,address) (runs: 256, μ: 129546, ~: 129546)
AuthTest:testSetAuthorityAsOwner() (gas: 32302)
AuthTest:testFailCallFunctionWithRestrictiveAuthority() (gas: 129144)
AuthTest:testFailCallFunctionWithRestrictiveAuthority(address) (runs: 256, μ: 129329, ~: 129329)
AuthTest:testFailSetAuthorityAsNonOwner() (gas: 18325)
AuthTest:testFailSetAuthorityAsNonOwner(address,address) (runs: 256, μ: 18594, ~: 18594)
AuthTest:testFailSetAuthorityWithRestrictiveAuthority() (gas: 129077)
AuthTest:testFailSetAuthorityWithRestrictiveAuthority(address,address) (runs: 256, μ: 129409, ~: 129409)
AuthTest:testFailTransferOwnershipAsNonOwner() (gas: 15641)
AuthTest:testFailTransferOwnershipAsNonOwner(address,address) (runs: 256, μ: 15922, ~: 15922)
AuthTest:testFailTransferOwnershipAsOwnerWithOutOfOrderAuthority() (gas: 136159)
AuthTest:testFailTransferOwnershipAsOwnerWithOutOfOrderAuthority(address) (runs: 256, μ: 136344, ~: 136344)
AuthTest:testFailTransferOwnershipWithRestrictiveAuthority() (gas: 129338)
AuthTest:testFailTransferOwnershipWithRestrictiveAuthority(address,address) (runs: 256, μ: 129588, ~: 129588)
AuthTest:testSetAuthorityAsOwner() (gas: 32214)
AuthTest:testSetAuthorityAsOwner(address) (runs: 256, μ: 32384, ~: 32384)
AuthTest:testSetAuthorityAsOwnerWithOutOfOrderAuthority() (gas: 226396)
AuthTest:testSetAuthorityWithPermissiveAuthority() (gas: 125963)
AuthTest:testSetAuthorityWithPermissiveAuthority(address,address) (runs: 256, μ: 130915, ~: 131012)
AuthTest:testSetOwnerAsOwner() (gas: 15298)
AuthTest:testSetOwnerAsOwner(address) (runs: 256, μ: 15492, ~: 15492)
AuthTest:testSetOwnerWithPermissiveAuthority() (gas: 127884)
AuthTest:testSetOwnerWithPermissiveAuthority(address,address) (runs: 256, μ: 130930, ~: 130949)
AuthTest:testSetAuthorityAsOwnerWithOutOfOrderAuthority() (gas: 226419)
AuthTest:testSetAuthorityWithPermissiveAuthority() (gas: 125962)
AuthTest:testSetAuthorityWithPermissiveAuthority(address,address) (runs: 256, μ: 130958, ~: 131055)
AuthTest:testTransferOwnershipAsOwner() (gas: 15298)
AuthTest:testTransferOwnershipAsOwner(address) (runs: 256, μ: 15469, ~: 15469)
AuthTest:testTransferOwnershipWithPermissiveAuthority() (gas: 127926)
AuthTest:testTransferOwnershipWithPermissiveAuthority(address,address) (runs: 256, μ: 130981, ~: 131000)
Bytes32AddressLibTest:testFillLast12Bytes() (gas: 223)
Bytes32AddressLibTest:testFromLast20Bytes() (gas: 191)
CREATE3Test:testDeployERC20() (gas: 853111)
CREATE3Test:testDeployERC20(bytes32,string,string,uint8) (runs: 256, μ: 923845, ~: 921961)
CREATE3Test:testDeployERC20(bytes32,string,string,uint8) (runs: 256, μ: 922796, ~: 921961)
CREATE3Test:testFailDoubleDeployDifferentBytecode() (gas: 9079256848778914174)
CREATE3Test:testFailDoubleDeployDifferentBytecode(bytes32,bytes,bytes) (runs: 256, μ: 5062195514745832485, ~: 8937393460516727435)
CREATE3Test:testFailDoubleDeploySameBytecode() (gas: 9079256848778906218)
CREATE3Test:testFailDoubleDeploySameBytecode(bytes32,bytes) (runs: 256, μ: 5027837975401088877, ~: 8937393460516728677)
CREATE3Test:testFailDoubleDeploySameBytecode(bytes32,bytes) (runs: 256, μ: 5027837975401088878, ~: 8937393460516728677)
DSTestPlusTest:testBound() (gas: 14214)
DSTestPlusTest:testBound(uint256,uint256,uint256) (runs: 256, μ: 2787, ~: 2793)
DSTestPlusTest:testBrutalizeMemory() (gas: 823)
Expand Down Expand Up @@ -287,43 +287,43 @@ MerkleProofLibTest:testValidProofSupplied() (gas: 2153)
MerkleProofLibTest:testVerifyEmptyMerkleProofSuppliedLeafAndRootDifferent() (gas: 1458)
MerkleProofLibTest:testVerifyEmptyMerkleProofSuppliedLeafAndRootSame() (gas: 1452)
MerkleProofLibTest:testVerifyInvalidProofSupplied() (gas: 2172)
MultiRolesAuthorityTest:testCanCallPublicCapability() (gas: 34292)
MultiRolesAuthorityTest:testCanCallPublicCapability(address,address,bytes4) (runs: 256, μ: 34478, ~: 34449)
MultiRolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 80556)
MultiRolesAuthorityTest:testCanCallWithAuthorizedRole(address,uint8,address,bytes4) (runs: 256, μ: 80845, ~: 80812)
MultiRolesAuthorityTest:testCanCallWithCustomAuthority() (gas: 422681)
MultiRolesAuthorityTest:testCanCallWithCustomAuthority(address,address,bytes4) (runs: 256, μ: 423100, ~: 423100)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability() (gas: 247674)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability(address,address,bytes4) (runs: 256, μ: 248127, ~: 248127)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole() (gas: 256845)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole(address,uint8,address,bytes4) (runs: 256, μ: 257185, ~: 257151)
MultiRolesAuthorityTest:testSetPublicCapabilities() (gas: 27762)
MultiRolesAuthorityTest:testSetPublicCapabilities(bytes4) (runs: 256, μ: 27871, ~: 27870)
MultiRolesAuthorityTest:testSetRoleCapabilities() (gas: 28985)
MultiRolesAuthorityTest:testSetRoleCapabilities(uint8,bytes4) (runs: 256, μ: 29126, ~: 29124)
MultiRolesAuthorityTest:testSetRoles() (gas: 29006)
MultiRolesAuthorityTest:testSetRoles(address,uint8) (runs: 256, μ: 29118, ~: 29104)
MultiRolesAuthorityTest:testSetTargetCustomAuthority() (gas: 27976)
MultiRolesAuthorityTest:testSetTargetCustomAuthority(address,address) (runs: 256, μ: 28050, ~: 28020)
OwnedTest:testCallFunctionAsNonOwner() (gas: 11311)
OwnedTest:testCallFunctionAsNonOwner(address) (runs: 256, μ: 16238, ~: 16257)
OwnedTest:testCallFunctionAsOwner() (gas: 10479)
OwnedTest:testSetOwner() (gas: 13035)
OwnedTest:testSetOwner(address) (runs: 256, μ: 13151, ~: 13170)
MultiRolesAuthorityTest:testCanCallPublicCapability() (gas: 34204)
MultiRolesAuthorityTest:testCanCallPublicCapability(address,address,bytes4) (runs: 256, μ: 34390, ~: 34361)
MultiRolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 80416)
MultiRolesAuthorityTest:testCanCallWithAuthorizedRole(address,uint8,address,bytes4) (runs: 256, μ: 80705, ~: 80671)
MultiRolesAuthorityTest:testCanCallWithCustomAuthority() (gas: 422439)
MultiRolesAuthorityTest:testCanCallWithCustomAuthority(address,address,bytes4) (runs: 256, μ: 422858, ~: 422858)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability() (gas: 247388)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesPublicCapability(address,address,bytes4) (runs: 256, μ: 247841, ~: 247841)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole() (gas: 256546)
MultiRolesAuthorityTest:testCanCallWithCustomAuthorityOverridesUserWithRole(address,uint8,address,bytes4) (runs: 256, μ: 256885, ~: 256852)
MultiRolesAuthorityTest:testSetPublicCapabilities() (gas: 27727)
MultiRolesAuthorityTest:testSetPublicCapabilities(bytes4) (runs: 256, μ: 27836, ~: 27835)
MultiRolesAuthorityTest:testSetRoleCapabilities() (gas: 28932)
MultiRolesAuthorityTest:testSetRoleCapabilities(uint8,bytes4) (runs: 256, μ: 29073, ~: 29072)
MultiRolesAuthorityTest:testSetRoles() (gas: 28918)
MultiRolesAuthorityTest:testSetRoles(address,uint8) (runs: 256, μ: 29030, ~: 29016)
MultiRolesAuthorityTest:testSetTargetCustomAuthority() (gas: 28102)
MultiRolesAuthorityTest:testSetTargetCustomAuthority(address,address) (runs: 256, μ: 28176, ~: 28146)
OwnedTest:testCallFunctionAsNonOwner() (gas: 11344)
OwnedTest:testCallFunctionAsNonOwner(address) (runs: 256, μ: 16252, ~: 16290)
OwnedTest:testCallFunctionAsOwner() (gas: 10435)
OwnedTest:testTransferOwnership() (gas: 13123)
OwnedTest:testTransferOwnership(address) (runs: 256, μ: 13154, ~: 13192)
ReentrancyGuardTest:invariantReentrancyStatusAlways1() (runs: 256, calls: 3840, reverts: 319)
ReentrancyGuardTest:testFailUnprotectedCall() (gas: 46147)
ReentrancyGuardTest:testNoReentrancy() (gas: 7515)
ReentrancyGuardTest:testProtectedCall() (gas: 33467)
RolesAuthorityTest:testCanCallPublicCapability() (gas: 33336)
RolesAuthorityTest:testCanCallPublicCapability(address,address,bytes4) (runs: 256, μ: 33487, ~: 33459)
RolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 79601)
RolesAuthorityTest:testCanCallWithAuthorizedRole(address,uint8,address,bytes4) (runs: 256, μ: 79879, ~: 79844)
RolesAuthorityTest:testSetPublicCapabilities() (gas: 29183)
RolesAuthorityTest:testSetPublicCapabilities(address,bytes4) (runs: 256, μ: 29297, ~: 29280)
RolesAuthorityTest:testSetRoleCapabilities() (gas: 30258)
RolesAuthorityTest:testSetRoleCapabilities(uint8,address,bytes4) (runs: 256, μ: 30488, ~: 30472)
RolesAuthorityTest:testSetRoles() (gas: 28986)
RolesAuthorityTest:testSetRoles(address,uint8) (runs: 256, μ: 29103, ~: 29089)
RolesAuthorityTest:testCanCallPublicCapability() (gas: 33409)
RolesAuthorityTest:testCanCallPublicCapability(address,address,bytes4) (runs: 256, μ: 33560, ~: 33532)
RolesAuthorityTest:testCanCallWithAuthorizedRole() (gas: 79995)
RolesAuthorityTest:testCanCallWithAuthorizedRole(address,uint8,address,bytes4) (runs: 256, μ: 80272, ~: 80238)
RolesAuthorityTest:testSetPublicCapabilities() (gas: 29095)
RolesAuthorityTest:testSetPublicCapabilities(address,bytes4) (runs: 256, μ: 29209, ~: 29192)
RolesAuthorityTest:testSetRoleCapabilities() (gas: 30276)
RolesAuthorityTest:testSetRoleCapabilities(uint8,address,bytes4) (runs: 256, μ: 30506, ~: 30489)
RolesAuthorityTest:testSetRoles() (gas: 29005)
RolesAuthorityTest:testSetRoles(address,uint8) (runs: 256, μ: 29122, ~: 29108)
SSTORE2Test:testFailReadInvalidPointer() (gas: 2927)
SSTORE2Test:testFailReadInvalidPointer(address,bytes) (runs: 256, μ: 3889, ~: 3892)
SSTORE2Test:testFailReadInvalidPointerCustomBounds() (gas: 3099)
Expand Down
8 changes: 4 additions & 4 deletions src/auth/Auth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity >=0.8.0;
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)
/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)
abstract contract Auth {
event OwnerUpdated(address indexed user, address indexed newOwner);
event OwnershipTransferred(address indexed user, address indexed newOwner);

event AuthorityUpdated(address indexed user, Authority indexed newAuthority);

Expand All @@ -17,7 +17,7 @@ abstract contract Auth {
owner = _owner;
authority = _authority;

emit OwnerUpdated(msg.sender, _owner);
emit OwnershipTransferred(msg.sender, _owner);
emit AuthorityUpdated(msg.sender, _authority);
}

Expand Down Expand Up @@ -45,10 +45,10 @@ abstract contract Auth {
emit AuthorityUpdated(msg.sender, newAuthority);
}

function setOwner(address newOwner) public virtual requiresAuth {
function transferOwnership(address newOwner) public virtual requiresAuth {
owner = newOwner;

emit OwnerUpdated(msg.sender, newOwner);
emit OwnershipTransferred(msg.sender, newOwner);
}
}

Expand Down
Loading

0 comments on commit 352e1e9

Please sign in to comment.