Golom contest - Soosh's results

An NFT marketplace that offers the lowest industry fee, a publicly available order-book along with analytical tools.

General Information

Platform: Code4rena

Start Date: 26/07/2022

Pot Size: $75,000 USDC

Total HM: 29

Participants: 179

Period: 6 days

Judge: LSDan

Total Solo HM: 6

Id: 148

League: ETH

Golom

Findings Distribution

Researcher Performance

Rank: 147/179

Findings: 1

Award: $35.17

🌟 Selected for report: 0

🚀 Solo Findings: 0

Low severity findings

GolomToken totalSupply can be slightly above the 1 billion cap

  • In the documentation (https://docs.golom.io/tokenomics-and-airdrop), the Golom Token should have a maximum supply of 1Billion Golom Tokens.
  • The actual maximum supply will be slightly above this number due to the addFee() emissions. The last emission can result in totalSupply >= 1_000_000_000
if (rewardToken.totalSupply() > 1000000000 * 10**18) {
	return;
}
  • The emissions rate depends on the number of stakers and totalSupply at the time so no definite number can be given.

Example: Say that totalSupply() is at 999_900_000 and total staked is 200_000_000.

uint256 tokenToEmit = (dailyEmission * (rewardToken.totalSupply() - rewardToken.balanceOf(address(ve)))) / rewardToken.totalSupply();

tokensToEmit = (600,000 * (999,900,000 - 200,000,000)) / 999,900,000 tokensToEmit = 479988 totalSupply = 999,900,000 + 4799878 totalSupply = 1,000,379,988

Recommendations:
  • Additonal logic can be explicitly added (additonal gas costs for each time addFee() is called)
  • Or, accept that Max supply can be slightly over 1 billion

Link:

QA Findings

GolomToken symbol differs from documentation

Link:

VoteEscrow tokens have different name and symbol from documentation

Link:

Time values can be more readable

  • Instead of
uint256 internal constant MAXTIME = 4 * 365 * 86400;
int128 internal constant iMAXTIME = 4 * 365 * 86400;
uint256 constant secsInDay = 24 * 60 * 60;
  • It can be more readable
uint256 internal constant MAXTIME = 4 years; int128 internal constant iMAXTIME = 4 years; uint256 constant secsInDay = 1 days;

Links:

Recommend using enums for orderType and order status for better code readability

For example, instead of

require(status == 3);

It can be cleaner

require(status == VALID);

Recommended enums:

enum OrderStatus {
	INVALID,
	EXPIRED,
	FILLED_OR_CANCELLED,
	VALID
}

enum OrderType {
	ASK,
	BID,
	CRITERIA_BID
}

Link:

Unneeded if check

The signaturesigner != o.signer if check is not needed as if it were true, the transaction would have already reverted from the above require(signaturesigner == o.signer, 'invalid signature') check.

require(signaturesigner == o.signer, 'invalid signature');
if (signaturesigner != o.signer) {
	return (0, hashStruct, 0);
}

Link:

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter