-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Maybe we should check if the status really changed or not
`_addAddressToTheList does not check if status actually changed. Maybe add require($._list[account] != status, "Status unchanged") for saving gas and only emit event if status really changes in enforcement module.
Pro:
- Save gas if the status does not change. A write store cost more that a read store
- Don't emit event if there is no change
Cons:
- Add a supplementary read operation for each change (more gas)
- Increase smart contract code size by adding a new check + custom error
As well as address(0)
Is address(0) checked anywhere (inside enforcement circuit) when adding to list?
Maybe checking it could prevent gas consumption or unexpected behavior like freezing address(0) which doesn’t make sense.
`
Pro: freezeing address(0) will prevent any mint which means that the enforcer role can prevent the minter role to mint tokens which break the separation of role
Cons: This increase gas cost for each operation and smart contract code size by adding a supplementary check