Skip to content

Commit

Permalink
Post Cantina Audit Minor Changes (#10)
Browse files Browse the repository at this point in the history
* Simplify version check in init library

* Call __UUPSUpgradeable_init() as best practice
  • Loading branch information
oldchili authored Jun 24, 2024
1 parent 45c9e12 commit b7a5dec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/NstInit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ library NstInit {
DssInstance memory dss,
NstInstance memory instance
) internal {
require(keccak256(abi.encodePacked(NstLike(instance.nst).version())) == keccak256(abi.encodePacked("1")), "NstInit/version-does-not-match");
require(keccak256(bytes(NstLike(instance.nst).version())) == keccak256("1"), "NstInit/version-does-not-match");
require(NstLike(instance.nst).getImplementation() == instance.nstImp, "NstInit/imp-does-not-match");

require(NstJoinLike(instance.nstJoin).vat() == address(dss.vat), "NstInit/vat-does-not-match");
Expand Down
2 changes: 2 additions & 0 deletions src/Nst.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ contract Nst is UUPSUpgradeable {
// --- Upgradability ---

function initialize() initializer external {
__UUPSUpgradeable_init();

wards[msg.sender] = 1;
emit Rely(msg.sender);
}
Expand Down

0 comments on commit b7a5dec

Please sign in to comment.