http://www.7klian.com

qqqdfsdfsdf

require(msg.sender == tx.origin);

//SlowMist// 挪用 YAM 的rebase 逻辑

{

public

}

uint256 indexDelta = offPegPerc;

// rebase

delegateAndReturn();

uint256 currSupply = yam.totalSupply();

uint256 mintAmount;

uint256 exchangeRate = getTWAP();

if (positive) {

assert(yam.yamsScalingFactor() <= yam.maxScalingFactor());

lastRebaseTimestampSec = now.sub(

indexDelta = indexDelta.sub(mintPerc);


require(lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now);

// calculates % change to supply

{

}

function rebase()

uint256 supplyAfterRebase = yam.rebase(epoch, indexDelta, positive);

afterRebase(mintAmount, offPegPerc);

// EOA only

// reduce indexDelta to account for minting

uint256 mintPerc = indexDelta.mul(rebaseMintPerc).div(10**18);

// ensure rebasing at correct time

if (positive) {

}

epoch; indexDelta; positive;

//SlowMist// 取当前 YAM 代币的供给量

// perform actions after rebase

indexDelta = indexDelta.div(rebaseLag);

// Apply the Dampening factor.

// This comparison also ensures there is no reentrancy.

// get twap from uniswap v2;

require(yam.yamsScalingFactor().mul(uint256(10**18).add(indexDelta)).div(10**18) < yam.maxScalingFactor(), "new scaling factor will be too big");

// Snap the rebase time to the start of this window.

YAMTokenInterface yam = YAMTokenInterface(yamAddress);

//SlowMist// 进入调解逻辑

(uint256 offPegPerc, bool positive) = computeOffPegPerc(exchangeRate);

epoch = epoch.add(1);

now.mod(minRebaseTimeIntervalSec)).add(rebaseWindowOffsetSec);

_inRebaseWindow();

mintAmount = currSupply.mul(mintPerc).div(10**18);

//SlowMist// 计较要调解的供给量

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

相关文章阅读