PolyRuby Token & Farm - Smart Contract Audit Report
Summary
PolyRuby is new token and yield farming platform.
We reviewed PolyRuby's contracts at the following addresses on the Polygon Mainnet:
Notes on the Token Contract:
- Currently, the total supply of the token is 272.
- The MasterChef contract has the ability to mint tokens up to the total supply of 18,696 tokens.
- 53% of the token's supply is in three liquidity pools.
- 33% of the token's supply is held in the MasterChef staking contract.
- 9% of the token's supply has been burned.
- The 'Operator' of the contract has the ability to set the maximum number of tokens that can be sent in a single transaction to any value at any time, and can exclude addresses from this restriction.
- Utilization of SafeMath throughout the platform to prevent overflow issues.
- Some gas optimizations can be achieved through marking functions external instead of public. As this contract is already deployed, this is informational.
- The contract utilizes SafeMath to prevent overflows.
Notes on the MasterChef Staking Contract:- Users can stake various tokens in this contract to earn rewards in the form of the project's native PolyRuby token.
- Users can also earn further token rewards by refering others to deposit into the contract.
- The team will set the reward rate for each pool when added and can update it at any time. Rewards are created by minting tokens.
- The developers will be minted some tokens from rewards to incentivize further development.
- Some gas optimizations can be achieved through marking functions external instead of public. As this contract is already deployed, this is informational.
- The team must exercise caution when adding tokens to avoid fee-on-transfer and ERC777-compliant tokens.
- Utilization of SafeMath to prevent overflow issues.
Audit Findings Summary
- No issues from external attackers were identified.
- Ensure trust in the team as they have substantial control in the ecosystem.
- Date: July 5th, 2021
External Threat Results
Vulnerability Category | Notes | Result |
---|---|---|
Arbitrary Storage Write | N/A | PASS |
Arbitrary Jump | N/A | PASS |
Delegate Call to Untrusted Contract | N/A | PASS |
Dependence on Predictable Variables | N/A | PASS |
Deprecated Opcodes | N/A | PASS |
Ether Thief | N/A | PASS |
Exceptions | N/A | PASS |
External Calls | N/A | PASS |
Integer Over/Underflow | N/A | PASS |
Multiple Sends | N/A | PASS |
Suicide | N/A | PASS |
State Change External Calls | N/A | PASS |
Unchecked Retval | N/A | PASS |
User Supplied Assertion | N/A | PASS |
Critical Solidity Compiler | N/A | PASS |
Overall Contract Safety | PASS |
Details: Token Contract
($) = payable function
# = non-constant function
Int = Internal
Ext = External
Pub = Public
+ [Lib] SafeMath
- [Int] tryAdd
- [Int] trySub
- [Int] tryMul
- [Int] tryDiv
- [Int] tryMod
- [Int] add
- [Int] sub
- [Int] mul
- [Int] div
- [Int] mod
- [Int] sub
- [Int] div
- [Int] mod
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] decimals
- [Ext] symbol
- [Ext] name
- [Ext] balanceOf
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ Context
- [Int] _msgSender
- [Int] _msgData
+ Ownable (Context)
- [Int] #
- [Pub] owner
- [Pub] renounceOwnership #
- modifiers: onlyOwner
- [Pub] transferOwnership #
- modifiers: onlyOwner
+ ERC20 (Context, IERC20, Ownable)
- [Pub] #
- [Pub] name
- [Pub] symbol
- [Pub] decimals
- [Pub] totalSupply
- [Pub] balanceOf
- [Pub] transfer #
- [Pub] allowance
- [Pub] approve #
- [Pub] transferFrom #
- [Pub] increaseAllowance #
- [Pub] decreaseAllowance #
- [Pub] mint #
- modifiers: onlyOwner
- [Int] _transfer #
- [Int] _mint #
- [Int] _burn #
- [Int] _approve #
- [Int] _burnFrom #
+ RubyToken (ERC20)
- [Pub] mint #
- modifiers: onlyOwner
- [Pub] #
- modifiers: ERC20
- [Pub] maxTransferAmount
- [Pub] updateMaxTransferAmountRate #
- modifiers: onlyOperator
- [Pub] isExcludedFromAntiWhale
- [Pub] setExcludedFromAntiWhale #
- modifiers: onlyOperator
- [Int] _transfer #
- modifiers: antiWhale
- [Pub] transferOperator #
- modifiers: onlyOperator
- [Ext] delegates
- [Ext] delegate #
- [Ext] delegateBySig #
- [Ext] getCurrentVotes
- [Ext] getPriorVotes
- [Int] _delegate #
- [Int] _moveDelegates #
- [Int] _writeCheckpoint #
- [Int] safe32
- [Int] getChainId
Details: MasterChef Contract
($) = payable function
# = non-constant function
Int = Internal
Ext = External
Pub = Public
+ [Int] IReferral
- [Ext] recordReferral #
- [Ext] getReferrer
+ [Lib] Address
- [Int] isContract
- [Int] sendValue #
- [Int] functionCall #
- [Int] functionCall #
- [Int] functionCallWithValue #
- [Int] functionCallWithValue #
- [Int] functionStaticCall
- [Int] functionStaticCall
- [Int] functionDelegateCall #
- [Int] functionDelegateCall #
- [Prv] _verifyCallResult
+ [Lib] SafeERC20
- [Int] safeTransfer #
- [Int] safeTransferFrom #
- [Int] safeApprove #
- [Int] safeIncreaseAllowance #
- [Int] safeDecreaseAllowance #
- [Prv] _callOptionalReturn #
+ [Lib] SafeMath
- [Int] tryAdd
- [Int] trySub
- [Int] tryMul
- [Int] tryDiv
- [Int] tryMod
- [Int] add
- [Int] sub
- [Int] mul
- [Int] div
- [Int] mod
- [Int] sub
- [Int] div
- [Int] mod
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] decimals
- [Ext] symbol
- [Ext] name
- [Ext] balanceOf
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ Context
- [Int] _msgSender
- [Int] _msgData
+ Ownable (Context)
- [Int] #
- [Pub] owner
- [Pub] renounceOwnership #
- modifiers: onlyOwner
- [Pub] transferOwnership #
- modifiers: onlyOwner
+ ERC20 (Context, IERC20, Ownable)
- [Pub] #
- [Pub] name
- [Pub] symbol
- [Pub] decimals
- [Pub] totalSupply
- [Pub] balanceOf
- [Pub] transfer #
- [Pub] allowance
- [Pub] approve #
- [Pub] transferFrom #
- [Pub] increaseAllowance #
- [Pub] decreaseAllowance #
- [Pub] mint #
- modifiers: onlyOwner
- [Int] _transfer #
- [Int] _mint #
- [Int] _burn #
- [Int] _approve #
- [Int] _burnFrom #
+ RubyToken (ERC20)
- [Pub] mint #
- modifiers: onlyOwner
- [Pub] #
- modifiers: ERC20
- [Pub] maxTransferAmount
- [Pub] updateMaxTransferAmountRate #
- modifiers: onlyOperator
- [Pub] isExcludedFromAntiWhale
- [Pub] setExcludedFromAntiWhale #
- modifiers: onlyOperator
- [Int] _transfer #
- modifiers: antiWhale
- [Pub] transferOperator #
- modifiers: onlyOperator
- [Ext] delegates
- [Ext] delegate #
- [Ext] delegateBySig #
- [Ext] getCurrentVotes
- [Ext] getPriorVotes
- [Int] _delegate #
- [Int] _moveDelegates #
- [Int] _writeCheckpoint #
- [Int] safe32
- [Int] getChainId
+ ReentrancyGuard
- [Int] #
+ MasterChef (Ownable, ReentrancyGuard)
- [Pub] #
- [Ext] poolLength
- [Ext] getPoolIdForLpToken
- [Ext] add #
- modifiers: onlyOwner,nonDuplicated
- [Ext] set #
- modifiers: onlyOwner
- [Pub] getMultiplier
- [Ext] pendingRuby
- [Pub] canHarvest
- [Pub] getHarvestUntil
- [Pub] massUpdatePools #
- [Pub] updatePool #
- [Pub] deposit #
- modifiers: nonReentrant
- [Pub] withdraw #
- modifiers: nonReentrant
- [Int] payOrLockupPendingRUBY #
- [Pub] emergencyWithdraw #
- modifiers: nonReentrant
- [Int] safeRubyTransfer #
- [Ext] setDevAddress #
- modifiers: onlyOwner
- [Ext] setFeeAddress #
- modifiers: onlyOwner
- [Ext] setVaultAddress #
- modifiers: onlyOwner
- [Ext] updateEmissionRate #
- modifiers: onlyOwner
- [Ext] setReferralAddress #
- modifiers: onlyOwner
- [Ext] setReferralCommissionRate #
- modifiers: onlyOwner
- [Int] payReferralCommission #
- [Ext] updateStartBlock #
- modifiers: onlyOwner
- [Ext] updateVaultDepositShare #
- modifiers: onlyOwner
Details: Referral Contract
($) = payable function
# = non-constant function
Int = Internal
Ext = External
Pub = Public
+ [Int] IReferral
- [Ext] recordReferral #
- [Ext] getReferrer
+ Context
- [Int] _msgSender
- [Int] _msgData
+ Ownable (Context)
- [Int] #
- [Pub] owner
- [Pub] renounceOwnership #
- modifiers: onlyOwner
- [Pub] transferOwnership #
- modifiers: onlyOwner
+ [Lib] Address
- [Int] isContract
- [Int] sendValue #
- [Int] functionCall #
- [Int] functionCall #
- [Int] functionCallWithValue #
- [Int] functionCallWithValue #
- [Int] functionStaticCall
- [Int] functionStaticCall
- [Int] functionDelegateCall #
- [Int] functionDelegateCall #
- [Prv] _verifyCallResult
+ [Lib] SafeMath
- [Int] tryAdd
- [Int] trySub
- [Int] tryMul
- [Int] tryDiv
- [Int] tryMod
- [Int] add
- [Int] sub
- [Int] mul
- [Int] div
- [Int] mod
- [Int] sub
- [Int] div
- [Int] mod
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] balanceOf
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ [Lib] SafeERC20
- [Int] safeTransfer #
- [Int] safeTransferFrom #
- [Int] safeApprove #
- [Int] safeIncreaseAllowance #
- [Int] safeDecreaseAllowance #
- [Prv] _callOptionalReturn #
+ Referral (IReferral, Ownable)
- [Pub] recordReferral #
- modifiers: onlyOperator
- [Pub] getReferrer
- [Ext] updateOperator #
- modifiers: onlyOwner