Skip to content

Commit

Permalink
Merge pull request #75 from morpho-org/fix-spearbit-1
Browse files Browse the repository at this point in the history
Fix #1
  • Loading branch information
Jean-Grimal authored Oct 29, 2024
2 parents 899b87f + 29db25b commit b2dbb1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/DelegationToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ abstract contract DelegationToken is IDelegation, ERC20PermitUpgradeable, Ownabl
bytes32 internal constant DELEGATION_TYPEHASH =
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");

// keccak256(abi.encode(uint256(keccak256("DelegationToken")) - 1)) & ~bytes32(uint256(0xff))
// keccak256(abi.encode(uint256(keccak256("morpho.storage.DelegationToken")) - 1)) & ~bytes32(uint256(0xff))
bytes32 internal constant DelegationTokenStorageLocation =
0xd583ef41af40c9ecf9cd08176e1b50741710eaecf057b22e93a6b99fa47a6400;
0x669be2f4ee1b0b5f3858e4135f31064efe8fa923b09bf21bf538f64f2c3e1100;

/* STORAGE LAYOUT */

Expand Down
2 changes: 1 addition & 1 deletion test/DelegationTokenInternalTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract DelegationTokenInternalTest is Test, DelegationToken {

function testDelegationTokenStorageLocation() public pure {
bytes32 expectedSlot =
keccak256(abi.encode(uint256(keccak256("DelegationToken")) - 1)) & ~bytes32(uint256(0xff));
keccak256(abi.encode(uint256(keccak256("morpho.storage.DelegationToken")) - 1)) & ~bytes32(uint256(0xff));
bytes32 usedSlot = DelegationTokenStorageLocation;
assertEq(expectedSlot, usedSlot, "Wrong slot used");
}
Expand Down

0 comments on commit b2dbb1a

Please sign in to comment.