Sweep coin

Storage

Fetch minter (stabilizer) info

Gets the information about a minter. Returns 4 values: 1. boolean that represents if the minter is listed or not. 2. uint that represents the max mint amount. 3. uint that represents the minted amount 4. boolean that represents if the minter can mint or not.

function minters(address minter)

Valid minters

Returns true if the minter is listed in the minter list and if they have a mix amount above of zero.

function isValidMinter(address minter)

Target prices

Fetches the current and the next target price.

function currentTargetPrice()

function nextTargetPrice()

Fetches the target price, that is used to peg the SWEEP price safely. If periodTime is over, returns the nextTargetPrice, otherwise the currentTargetPrice.

function targetPrice()

Interest rate periods

Fetches the period's start time.

function periodStart()

Fetches the delta amount of interest rate to increase/decrease. It has 6 decimals of precision. 1% = 10.000.

function stepValue()

Total supply

Displays the total floating SWEEP (minted amount).

function totalSupply()

Admin Role

Approve a stabilizer deal and add to the minter list

The most important action for Sweep governance is to control the list of Stabilizers that it funds. Each Stabilizer represents an asset, and a maximum allocation to that asset. Stabilizers should match the mission, liquidity requirements, and risk tolerance of SWEEP.

function addMinter(address minter, uint256 maxAmount)
  • minter: Address to be added into minter list

  • maxAmount: Max amount for mint

Change the max mint amount (borrow limit)

This is how to change the borrow limit or turn off borrowing

function setMinterMaxAmount(address minter, uint256 maxAmount)
  • minter: Minter address

  • maxAmount: Max mint amount to be changed

Enable/disable a specific minter

On/Off minting for a specific address.

function setMinterEnabled(address minter, bool enabled)

Change transfer permissioning

This is how to change transfer approver

function setTransferApprover(address approver)

approver: New contract address for transfer approving

Change interest rate

This is how to change interest rate of SWEEP

function setInterestRate(int256 dailyRate, uint256 newPeriodStart)

dailyRate: Interest rate for SWEEP that be changed every day. newPeriodStart: New period start time.

Change target price

Sets the current target price and the next target price.

funciton setTargetPrice(uint256 newCurrentTargetPrice)

Set step value

The value to increment/decrement the interest rate every time there is the interest rate is refreshed.

function setStepValue(int256 newStepValue)

Pause SWEEP

This is how to pause transfer of SWEEP token

function pause()

Unpause SWEEP

This is how to unpause transfer of SWEEP token

function unpause()

Change the treasury address

Sets the treasury address

function setTreasury(address newTreasury)

Change the balancer

Sets the balancer address

function setBalancer(address newBalancer)

Code upgrades

Sweep code will be upgradeable during the beta period.

The SWEEP coin, Sweep.sol, is an upgradeable proxy contract. It can accept code upgrades from the contract owner.

The contract owner is controlled by protocol governance in the following way [describe]

Stabilizer code cannot be upgraded. The code for a Stabilizer represents a specific agreement between the protocol and a borrower. To change this agreement, the protocol and the borrower should create and fund a new Stabilizer. The protocol will then set the borrow limits to zero on the old Stabilizer and request redemption.

Other contracts can be upgraded by deploying new versions, and attaching the new versions to the Sweep.sol contract. This will help the protocol change the logic of the Balancer and the transfer permissions.

Last updated