Skip to content

Commit

Permalink
feat: add diff script and remove garbage
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Dec 5, 2024
1 parent cb4c608 commit 7e4ea6b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Empty file.
Empty file.
24 changes: 24 additions & 0 deletions flattened/Collector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1170,3 +1170,27 @@ contract Collector is VersionedInitializable, ICollector, ReentrancyGuard {
return true;
}
}

// src/CustomCollector.sol

/**
* @title Collector
* Custom modifications of this implementation:
* - the initialize function manually alters private storage slots via assembly
* - storage slot 51 is reset to 0
* - storage slot 52 is set to 1 (which is the default state of the reentrancy guard)
* @author BGD Labs
**/
contract CollectorWithCustomImpl is Collector {
constructor(address aclManager) Collector(aclManager) {
// intentionally left empty
}

/// @inheritdoc ICollector
function initialize(uint256) external virtual override initializer {
assembly {
sstore(51, 0) // this slot was _status, but is now part of the gap
sstore(52, 1) // this slot was the funds admin, but is now "status"
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"diff": "bun diff.ts"
},
"author": "",
"license": "MIT",
Expand Down

0 comments on commit 7e4ea6b

Please sign in to comment.