Skip to content

Commit

Permalink
fix: Small additional audit fixes (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
Whytecrowe authored Dec 1, 2023
2 parents 8b2976d + da3f9d9 commit 640747b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/price/ZNSCurvePricer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ contract ZNSCurvePricer is AAccessControlled, ARegistryWired, UUPSUpgradeable, I
* @notice Setter for `priceConfigs[domainHash]`. Only domain owner/operator can call this function.
* @dev Validates the value of the `precisionMultiplier` and the whole config in order to avoid price spikes,
* fires `PriceConfigSet` event.
* Only ADMIN can call this function.
* Only the owner of the domain or an allowed operator can call this function
* > This function should ALWAYS be used to set the config, since it's the only place where `isSet` is set to true.
* > Use the other individual setters to modify only, since they do not set this variable!
* @param domainHash The domain hash to set the price config for
Expand Down
1 change: 1 addition & 0 deletions contracts/registrar/IZNSSubRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface IZNSSubRegistrar is IDistributionConfig {
*/
event MintlistUpdated(
bytes32 indexed domainHash,
uint256 indexed ownerIndex,
address[] candidates,
bool[] allowed
);
Expand Down
2 changes: 1 addition & 1 deletion contracts/registrar/ZNSSubRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ contract ZNSSubRegistrar is AAccessControlled, ARegistryWired, UUPSUpgradeable,
mintlistForDomain.list[ownerIndex][candidates[i]] = allowed[i];
}

emit MintlistUpdated(domainHash, candidates, allowed);
emit MintlistUpdated(domainHash, ownerIndex, candidates, allowed);
}

function isMintlistedForDomain(
Expand Down
2 changes: 2 additions & 0 deletions docs/roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ ownership.
- The function `ZNSRootRegister.coreRegister()` allows registrars to register domains.
- The function `ZNSRegistry.createDomainRecord()` allows registrars to register domain records which track ownership and address
resolver.
- The function `ZNSRegistry.addResolverType` allows admins to add new types of resolvers
- The function `ZNSRegistry.deleteResolverType` allows admins to remove an existing type of resolver.
- The function `ZNSDomainToken.register()` allows registrars to mint tokens which are used to validate domain ownership.
- The function `ZNSDomainToken.revoke()` allows registrars to burn tokens to revoke domain ownership.
- The function `ZNSTreasury.stakeForDomain()` allows registrars to process registration fee to beneficiaries and stake domain funds
Expand Down
3 changes: 3 additions & 0 deletions test/ZNSSubRegistrar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2729,7 +2729,10 @@ describe("ZNSSubRegistrar", () => {
);
const event = events[events.length - 1];

const ownerIndex = await zns.subRegistrar.mintlist(domainHash);

expect(event.args?.domainHash).to.eq(domainHash);
expect(event.args?.ownerIndex).to.eq(ownerIndex);
expect(event.args?.candidates).to.deep.eq(candidatesArr);
expect(event.args?.allowed).to.deep.eq(allowedArr);
});
Expand Down

0 comments on commit 640747b

Please sign in to comment.