Platform: Code4rena
Start Date: 12/07/2022
Pot Size: $35,000 USDC
Total HM: 13
Participants: 78
Period: 3 days
Judge: 0xean
Total Solo HM: 6
Id: 135
League: ETH
Rank: 24/78
Findings: 1
Award: $150.95
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: joestakey
Also found by: 0x040, 0x1f8b, 0xDjango, 0xNazgul, 0xsam, Avci, Aymen0909, Bnke0x0, CRYP70, ElKu, Fitraldys, Funen, JC, Kaiziron, MadWookie, Meera, ReyAdmirado, Sm4rty, Soosh, TomJ, Waze, _Adam, __141345__, ajtra, benbaessler, c3phas, csanuragjain, durianSausage, exd0tpy, fatherOfBlocks, hake, ignacio, karanctf, kyteg, m_Rassska, oyc_109, rbserver, robee, rokinot, samruna, sashik_eth, simon135, slywaters
150.9476 USDC - $150.95
address public aaveAddr; // TODO immutable?
setSwivel()
needs to exist. I believe this function can be removed and change swivel
to immutable and set in the constructor.function setSwivel(address s) external authorized(admin) returns (bool) { if (swivel != address(0)) { revert Exception(20, 0, 0, swivel, address(0)); } swivel = s; return true; }
unchecked {i++;}
x += y
costs more gas than x = x + y
for state variablesfilled[hash] += a;
feenominators = [200, 600, 400, 200];
initiateVaultFillingZcTokenInitiate()
initiateZcTokenFillingVaultInitiate()
initiateZcTokenFillingZcTokenExit()
initiateVaultFillingVaultExit()
exitZcTokenFillingZcTokenInitiate()
exitVaultFillingVaultInitiate()
exitVaultFillingZcTokenExit()
exitZcTokenFillingVaultExit()
string constant public NAME = 'Swivel Finance';
string constant public VERSION = '3.0.0';
uint256 constant public HOLD = 3 days;
uint16 constant public MIN_FEENOMINATOR = 33;
msg.value
> 0 check.setAdmin()
scheduleWithdrawal()
blockWithdrawal()
withdraw()
scheduleFeeChange()
blockFeeChange()
setFee()
scheduleApproval()
blockApproval()
approveUnderlying()
create()
setAdmin()
setMarketPlace()
setSwivel()
Vault memory vault = vaults[o];
Market memory market = markets[p][u][m];
market.zcToken
can be cached instead of the whole struct.from
is needed for the if statement so to
should be cached to memory after the if to save gas on a revert.Vault memory from = vaults[f]; Vault memory to = vaults[t]; if (a > from.notional) { revert Exception(31, a, from.notional, address(0), address(0)); }
File: VaultTracker.sol#L155-158
to
can be defined on line 179Vault memory to = vaults[t];
uint8 public immutable protocol;
uint16 constant public MIN_FEENOMINATOR = 33;
function setFee(uint16[] memory i, uint16[] memory d) external authorized(admin) returns (bool)
function authRedeem(uint8 p, address u, uint256 m, address f, address t, uint256 a) public authorized(markets[p][u][m].zcToken) returns (uint256 underlyingAmount) {
#0 - robrobbins
2022-08-31T17:47:13Z
addressing
partially addressing. any cached struct that has less that 2 fields referenced was changed. there were 2 instances of that.
9: addressing
others were dupes or wontfix