Skip to main content

Migrating from 2.0 to 2.1 Smart Contracts

MultiVault

Last Active Epoch is now User Epoch History

The lastActiveEpoch mapping in the MultiVault contract has been replaced with a more comprehensive userEpochHistory mapping. This new mapping tracks up 3 epochs in which each user has been active.

Previous:

mapping(address => uint256) public lastActiveEpoch;

Current:

mapping(address => uint256[3]) public userEpochHistory;

To get the last active epoch of a user, you can now use the following function:

function getUserLastActiveEpoch(address user) external view returns (uint256) {
return userEpochHistory[user][0];
}

MultiVault Config

The GeneralConfig struct has been updated to include a new parameter feeThreshold and remove the decimalPrecision parameter.

struct GeneralConfig {
address admin;
address protocolMultisig;
uint256 feeDenominator;
address trustBonding;
uint256 minDeposit;
uint256 minShare;
uint256 atomDataMaxLength;
uint256 feeThreshold;
}

Previously the GeneralConfig struct contained the decimalPrecision parameter that has been removed in this version.

struct GeneralConfig {
address admin;
address protocolMultisig;
uint256 feeDenominator;
address trustBonding;
uint256 minDeposit;
uint256 minShare;
uint256 atomDataMaxLength;
uint256 decimalPrecision;
}

The getGeneralConfig function now reflects the updated GeneralConfig struct:

function getGeneralConfig() external view returns (GeneralConfig memory);

Triple Config

The tripleConfig struct has been updated to include only two parameters: tripleCreationProtocolFee and atomDepositFractionForTriple.

struct TripleConfig {
uint256 tripleCreationProtocolFee;
uint256 atomDepositFractionForTriple;
}

Previously the tripleConfig struct contained totalAtomDepositsOnTripleCreation parameters that have been removed in this version.

struct TripleConfig {
uint256 tripleCreationProtocolFee;
uint256 totalAtomDepositsOnTripleCreation;
uint256 atomDepositFractionForTriple;
}

The getTripleConfig return value now reflects the updated TripleConfig struct:

getTripleConfig() external view returns (TripleConfig memory);

Bonding Curves

Offset Progressive Curve

The OffsetProgressiveCurve.sol contract no longer auto-scales the slope parameter during initialization. The slope parameter should now be provided in its scaled form.

Previous:

SLOPE=2;

Current:

SLOPE=2e18;