Platform: Code4rena
Start Date: 11/01/2023
Pot Size: $60,500 USDC
Total HM: 6
Participants: 69
Period: 6 days
Judge: Trust
Total Solo HM: 2
Id: 204
League: ETH
Rank: 45/69
Findings: 1
Award: $36.24
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: CodingNameKiki
Also found by: 0x1f8b, 0x52, 0x5rings, 0xAgro, 0xSmartContract, 0xcm, 0xkato, 2997ms, Aymen0909, BClabs, BPZ, BRONZEDISC, Bauer, Bnke0x0, Deekshith99, IllIllI, Josiah, Kaysoft, RaymondFam, Rolezn, SaeedAlipoor01988, Tajobin, Udsen, Viktor_Cortess, adriro, arialblack14, betweenETHlines, btk, chaduke, chrisdior4, cryptphi, csanuragjain, cygaar, defsec, descharre, erictee, gzeon, hansfriese, horsefacts, joestakey, koxuan, lukris02, luxartvinsec, nicobevi, oyc_109, pavankv, peanuts, rbserver, scokaf, shark, tnevler, tsvetanovv, zaskoh
36.2377 USDC - $36.24
Context:
function setFeeRecipient(
L452function setAssetRecipient(
L465function setAssetSender(
L803function _setKYCRegistry(address _kycRegistry) internal {
L39Recommendation:
The best practice is to use two-step procedure for critical changes to make them less error-prone.
Context:
return totalCashAmountRefunded;
L795Recommendation:
Choose named return variable or return statement. It is unnecessary to use both.
Context:
bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
L22keccak256("KYC_CONFIGURER_ROLE");
L27keccak256("KYC_CONFIGURER_ROLE");
L27bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
L44bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
L45bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
L44bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
L45keccak256(
L32bytes32 public constant MANAGER_ADMIN = keccak256("MANAGER_ADMIN");
L122bytes32 public constant PAUSER_ADMIN = keccak256("PAUSER_ADMIN");
L123bytes32 public constant SETTER_ADMIN = keccak256("SETTER_ADMIN");
L124Description:
According to official solidity documentation for a constant variable, the expression assigned to it is copied to all the places where it is accessed and also re-evaluated each time. It is recommended to use immutable instead.
Context:
exchangeRateDeltaLimit = _exchangeRateDeltaLimit;
L396mintFee = _mintFee;
L417minimumDepositAmount = _minimumDepositAmount;
L440feeRecipient = _feeRecipient;
L456epochDuration = _epochDuration;
L550mintLimit = _mintLimit;
L598redeemLimit = _redeemLimit;
L613assetSender = newAssetSender;
L807minimumRedeemAmount = newRedeemMinimum;
L821kycRegistry = IKYCRegistry(_kycRegistry);
L44kycRequirementGroup = _kycRequirementGroup;
L56Recommendation:
Example how to fix require(_newOwner != owner, " Same address");
Context:
event CashDeployed(
L143 (event definition can not go after external function)event CashKYCSenderDeployed(
L153 (event definition can not go after external function)function assignRoletoKYCGroup(
L144 (external function can not go after external view function)pragma solidity 0.8.16;
L19 (pragma directive can not go after import directive)pragma solidity 0.8.16;
L20 (pragma directive can not go after import directive)pragma solidity 0.8.16;
L20 (pragma directive can not go after import directive)event FTokenToCTokenSet(
L41 (event definition can not go after external function)event FTokenToCTokenSet(
L41 (event definition can not go after external function)event PriceCapSet(
L101 (event definition can not go after external function)Description:
According to official solidity documentation functions should be grouped according to their visibility and ordered:
constructor
receive function (if exists)
fallback function (if exists)
external
public
internal
private
Within a grouping, place the view and pure functions last.
Recommendation:
Put the functions in the correct order according to the documentation.
Context:
Context:
* `kycRequirementGroup`. In order to sucessfully call this function,
L62 (Change sucessfully to successfully)* @param addresses Array of addresses being added as elligible
L205 (Change elligible to eligible)* @param addresses Array of addresses being added as elligible
L236 (Change elligible to eligible)/// @notice Error for when caller attempts to set the KYC registry refernce
L38 (Change refernce to reference)#0 - c4-judge
2023-01-23T12:39:55Z
trust1995 marked the issue as grade-b