Tsunami-Exchange / tsunami-contracts

Tsunami Exchange Smart Contracts (RIDE)
2 stars 2 forks source link

Brief audit of `mining.ride` #5

Open deemru opened 2 years ago

deemru commented 2 years ago

LOW: Adding a new cross-linked with other contracts functionality with open to everyone initialize() becomes risky: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/18d902fe2e1aa10292aa6141df9690401c86ec2a/contracts/ride/mining.ride#L259-L273

LOW: Whats wrong with built-in makeString() and split()? https://github.com/Tsunami-Exchange/tsunami-contracts/blob/18d902fe2e1aa10292aa6141df9690401c86ec2a/contracts/ride/mining.ride#L42-L50

MEDIUM: No check period is locked (can lead to selflock and unable to claim rewards in future): https://github.com/Tsunami-Exchange/tsunami-contracts/blob/18d902fe2e1aa10292aa6141df9690401c86ec2a/contracts/ride/mining.ride#L280-L299

LOW: Performance, second reading same value: https://github.com/Tsunami-Exchange/tsunami-contracts/blob/18d902fe2e1aa10292aa6141df9690401c86ec2a/contracts/ride/mining.ride#L224

LOW: Performance, is there really amm with more than 1 assetId? Why not store pairs? https://github.com/Tsunami-Exchange/tsunami-contracts/blob/18d902fe2e1aa10292aa6141df9690401c86ec2a/contracts/ride/mining.ride#L318-L319