Skip to content

FluidBuyback ​

Git Source

Inherits:ReentrancyGuard, Events, UUPSUpgradeable

Functions ​

constructor ​

solidity
constructor() ;

initialize ​

initializes the contract with owner_ as owner and rebalancers_ as rebalancers and build the buyback DSA

solidity
function initialize(address owner_, address[] memory rebalancers_) public initializer validAddress(owner_);

Parameters

NameTypeDescription
owner_addressthe owner of the contract
rebalancers_address[]the rebalancers of the contract

_authorizeUpgrade ​

UUPS Upgrade authorization - only owner can authorize upgrades

solidity
function _authorizeUpgrade(address) internal override onlyOwner;

renounceOwnership ​

override renounce ownership as it could leave the contract in an unwanted state if called by mistake.

solidity
function renounceOwnership() public view override onlyOwner;

swap ​

swaps sellAmount_ of tokenIn_ for tokenOut_

solidity
function swap(
    address tokenIn_,
    address tokenOut_,
    uint256 sellAmount_,
    uint256 minBuyAmount_,
    string[] memory swapConnectors_,
    bytes[] memory swapCalldatas_
) public onlyRebalancer nonReentrant returns (uint256 buyAmount_);

Parameters

NameTypeDescription
tokenIn_addressthe token to sell
tokenOut_addressthe token to buy
sellAmount_uint256the amount of tokenIn_ to sell
minBuyAmount_uint256the minimum amount of tokenOut_ to buy
swapConnectors_string[]the connectors to use for the swap
swapCalldatas_bytes[]the calldatas to use for the swap

Returns

NameTypeDescription
buyAmount_uint256the amount of tokenOut_ bought

collectFluidTokensToTreasury ​

collects amount_ of Fluid tokens to the treasury - only rebalancers can collect Fluid tokens

solidity
function collectFluidTokensToTreasury(uint256 amount_) public onlyRebalancer nonReentrant;

Parameters

NameTypeDescription
amount_uint256the amount of Fluid tokens to collect

collectTokensToTreasury ​

collects amount_ of token_ to the treasury - only owner can collect tokens

solidity
function collectTokensToTreasury(address token_, uint256 amount_) public onlyOwner nonReentrant;

Parameters

NameTypeDescription
token_addressthe token to collect
amount_uint256the amount of token_ to collect

updateRebalancer ​

updates the rebalancer status - only owner can update the rebalancer status

solidity
function updateRebalancer(address rebalancer_, bool isActive_) public onlyOwner nonReentrant;

Parameters

NameTypeDescription
rebalancer_addressthe rebalancer to update
isActive_boolthe status of the rebalancer

receive ​

solidity
receive() external payable;