Skip to content

Latest commit

 

History

History
354 lines (309 loc) · 11.2 KB

IProtocol.md

File metadata and controls

354 lines (309 loc) · 11.2 KB

FeeSharingCollectorStorage contact (IProtocol.sol)

View Source: contracts/governance/FeeSharingCollector/FeeSharingCollectorStorage.sol

↗ Extends: Ownable

IProtocol contract

Just the storage part of FeeSharingCollector contract, and FeeSharingCollectorProxy. No functions, only constant, variables and required structures (mappings)

Structs

Checkpoint

struct Checkpoint {
 uint32 blockNumber,
 uint32 timestamp,
 uint96 totalWeightedStake,
 uint96 numTokens
}

Contract Members

Constants & Variables

//internal members
uint256 internal constant FEE_WITHDRAWAL_INTERVAL;
uint256 internal constant REENTRANCY_GUARD_FREE;
uint256 internal constant REENTRANCY_GUARD_LOCKED;
uint256 internal reentrancyLock;
struct EnumerableAddressSet.AddressSet internal whitelistedConverterList;

//public members
contract IProtocol public protocol;
contract IStaking public staking;
mapping(address => mapping(uint256 => struct FeeSharingCollectorStorage.Checkpoint)) public tokenCheckpoints;
mapping(address => uint256) public totalTokenCheckpoints;
mapping(address => mapping(address => uint256)) public processedCheckpoints;
mapping(address => uint256) public lastFeeWithdrawalTime;
mapping(address => uint96) public unprocessedAmount;
mapping(bytes4 => bool) public isFunctionExecuted;

Modifiers

nonReentrant

Prevents a contract from calling itself, directly or indirectly. If you mark a function nonReentrant, you should also mark it external. Calling one nonReentrant function from another is not supported. Instead, you can implement a private function doing the actual work, and an external wrapper marked as nonReentrant.

modifier nonReentrant() internal

Functions


withdrawFees

function withdrawFees(address[] tokens, address receiver) external nonpayable
returns(totalWRBTCWithdrawn uint256)

Arguments

Name Type Description
tokens address[] The array address of the token instance.
receiver address The address of the withdrawal recipient. *

Returns

The withdrawn total amount in wRBTC

Source Code
function withdrawFees(address[] calldata tokens, address receiver)
        external
        returns (uint256 totalWRBTCWithdrawn);

underlyingToLoanPool

function underlyingToLoanPool(address token) external view
returns(address)

Arguments

Name Type Description
token address
Source Code
function underlyingToLoanPool(address token) external view returns (address);

wrbtcToken

function wrbtcToken() external view
returns(contract IWrbtcERC20)
Source Code
function wrbtcToken() external view returns (IWrbtcERC20);

getSovTokenAddress

function getSovTokenAddress() external view
returns(address)
Source Code
function getSovTokenAddress() external view returns (address);

Contracts