function setIncentiveContract(address account, address incentive) external {
require(
accessControl.hasRole(GOVERNANCE_TOKEN_MANAGER_ROLE, _msgSender()),
"Dollar: must have admin role"
);
incentiveContract[account] = incentive;
emit IncentiveContractUpdate(account, incentive);
}
The issue here is with access control given to the above function. The revert message states "Dollar: must have admin role", it means the function is expected to have Admin role as only address who can access the UbiquityDollarToken.setIncentiveContract() function, However, the GOVERNANCE_TOKEN_MANAGER_ROLE is set which seems to be incorrect. On further study on this issue, the readme docs of incentive further confirms that the acces control should be given to Admin role.
Title
Incorrect access control or stale Natspec/docs on
UbiquityDollarToken.setIncentiveContract()
Vulnerability details
UbiquityDollarToken.setIncentiveContract() is used to set incentive contracts for accounts.
The issue here is with access control given to the above function. The revert message states
"Dollar: must have admin role"
, it means the function is expected to haveAdmin role
as only address who can access theUbiquityDollarToken.setIncentiveContract()
function, However, theGOVERNANCE_TOKEN_MANAGER_ROLE
is set which seems to be incorrect. On further study on this issue, the readme docs of incentive further confirms that the acces control should be given to Admin role.Per interface.IIncentive.md,
Per IIncentive.sol
It can be said that the issue either relies with stale or incorrect readme documentation or Natspec or Incorrect function access implementation.
Recommendation
If the
UbiquityDollarToken.setIncentiveContract()
function is expected to be called by admin then do the following change,OR . . .
If function implementation is correct then correct the stale docs/Natspec mentioning tokenManager instead of Admin to avoid confusion to code readers.
cc- @pavlovcik @molecula451