This is a contest to evaluate the entirety of the GoGoPool Protocol, a decentralized liquid staking protocol on Avalanche. Our mission is to be the easiest way to stake AVAX. GoGoPool allows users with hardware and 1000 AVAX to create a validator node in conjunction with funds deposited by liquid staking users.
Gogopool은 아발란체에서 밸리데이터의 진입장벽을 낮추고 스테이킹을 원활하게 도와주는 프로젝트다.
Contract | SLOC | Purpose | Libraries used |
---|---|---|---|
Base.sol | 8 | Modifiers, helper methods and storage method wrappers shared between contracts | |
BaseUpgradeable.sol | 9 | Openzeppelin upgradeable version of Base | @openzeppelin/Initializable |
BaseAbstract.sol | 145 | Parent contract for Base and BaseUpgradeable | |
ClaimNodeOp.sol | 84 | Claim contract for Node Operator GGP rewards | @solmate/ERC4626, FixedPointMathLib |
ClaimProtocolDAO.sol | 25 | Claim contract for Protocol DAO GGP rewards | |
MinipoolManager.sol | 435 | Minipool functionality, e.g. creating, initiating staking | @solmate/ERC4626, FixedPointMathLib, ReentrancyGuard, SafeTransferLib |
MultisigManager.sol | 68 | Multisig management functionality, e.g. enabling and disabling multisigs | |
Ocyticus.sol | 49 | Protocol pause functionality | |
Oracle.sol | 41 | Price oracle for GGP token | |
ProtocolDAO.sol | 122 | Defines and allows for modifying protocol settings | |
RewardsPool.sol | 153 | Handles GGP reward cycles including inflation and distribution | @solmate/FixedPointMathLib |
Staking.sol | 256 | Maintains information on stakers (anyone staking GGP or AVAX) | @solmate/ERC20, FixedPointMathLib, SafeTransferLib |
Storage.sol | 113 | Implements data separation pattern and maintains storage for all netowrk contracts with generic getters/setters. Contracts are registered with storage to define their ability to interact with stored variables | |
Vault.sol | 129 | Stores AVAX/ERC20 tokens on behalf of network contracts, to maintain their upgradeability | @solmate/ERC20, ReentrancyGuard, SafeTransferLib |
TokenGGP.sol | 8 | Fixed-supply, non-upgradeable ERC20 token | @solmate/ERC20 |
TokenggAVAX.sol | 174 | An upgradeable (via OpenZeppelin proxy) ERC4626 yield-bearing liquid staking token | @openzeppelin/Initializable, UUPSUpgradeable + @solmate/ERC20, FixedPointMathLib, SafeCastLib, SafeTransferLib |
ERC20Upgradeable.sol | 119 | Upgradeable version of Solmate's ERC20 Token | |
ERC4626Upgradeable.sol | 102 | Upgradeable version of Solmate's ERC4626 Token | @solmate/ERC20, FixedPointMathLib, SafeTransferLib, Initializable |
아무런 결함도 발견하지 못했다.. 결함을 발견했다고 생각했었는데 내가 생각해도 너무 억지스러운 면이 있었다. 부족함을 인정하고 리포트를 꾸준히 읽어나가자..
이자가 자동적으로 발생하는 베어링 토큰에 대한 표준 규격이다. 베어링 토큰의 기초가 되는 자산의 사용여부나 지분율에 따라 vault에 입금, 출금, 잔액 확인 기능을 제공한다.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {FixedPointMathLib} from "@rari-capital/solmate/src/utils/FixedPointMathLib.sol";
contract Test {
using FixedPointMathLib for uint256;
uint256 first = 7;
uint256 second = 10;
uint256 result = 3;
function getPrice() public view returns (uint256) {
return result.mulDivDown(first, second);
}
}
FixedPointMathLib
에서 제공하는 함수로 나눴을 때 가장 가까운 정수를 나타내기 위해 사용한다. 위 예에서 (3 * 7) / 10 = 2.1
이 되는데 가장 가까운 정수인 2를 리턴한다. 반면 mulDivUp
을 하면 올림 처리해서 3을 리턴한다.