Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions contracts/contracts/vault/VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import "./VaultInitializer.sol";
contract VaultCore is VaultInitializer {
using SafeERC20 for IERC20;
using StableMath for uint256;
// max signed int
/// @dev max signed int
uint256 internal constant MAX_INT = 2**255 - 1;
// max un-signed int
/// @dev max un-signed int
uint256 internal constant MAX_UINT =
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

Expand All @@ -45,6 +45,9 @@ contract VaultCore is VaultInitializer {
_;
}

/**
* @dev Verifies that the caller is the AMO strategy.
*/
modifier onlyOusdMetaStrategy() {
require(
msg.sender == ousdMetaStrategy,
Expand All @@ -67,6 +70,12 @@ contract VaultCore is VaultInitializer {
_mint(_asset, _amount, _minimumOusdAmount);
}

/**
* @dev Deposit a supported asset and mint OTokens.
* @param _asset Address of the asset being deposited
* @param _amount Amount of the asset being deposited
* @param _minimumOusdAmount Minimum OTokens to mint
*/
function _mint(
address _asset,
uint256 _amount,
Expand Down Expand Up @@ -731,6 +740,11 @@ contract VaultCore is VaultInitializer {
}
}

/**
* @dev Get the number of decimals of a token asset
* @param _asset Address of the asset
* @return decimals number of decimals
*/
function _getDecimals(address _asset)
internal
view
Expand All @@ -749,6 +763,7 @@ contract VaultCore is VaultInitializer {

/**
* @notice Gets the vault configuration of a supported asset.
* @param _asset Address of the token asset
*/
function getAssetConfig(address _asset)
public
Expand Down
9 changes: 5 additions & 4 deletions contracts/contracts/vault/VaultStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,15 @@ contract VaultStorage is Initializable, Governable {
// slither-disable-next-line uninitialized-state
OUSD internal oUSD;

//keccak256("OUSD.vault.governor.admin.impl");
/// @dev Storage slot for the address of the VaultAdmin contract that is delegated to
// keccak256("OUSD.vault.governor.admin.impl");
bytes32 constant adminImplPosition =
0xa2bd3d3cf188a41358c8b401076eb59066b09dec5775650c0de4c55187d17bd9;

// Address of the contract responsible for post rebase syncs with AMMs
/// @dev Address of the contract responsible for post rebase syncs with AMMs
address private _deprecated_rebaseHooksAddr = address(0);

// Deprecated: Address of Uniswap
/// @dev Deprecated: Address of Uniswap
// slither-disable-next-line constable-states
address private _deprecated_uniswapAddr = address(0);

Expand Down Expand Up @@ -221,7 +222,7 @@ contract VaultStorage is Initializable, Governable {
/// @notice Mapping of withdrawal request indices to the user withdrawal request data
mapping(uint256 => WithdrawalRequest) public withdrawalRequests;

// For future use
/// @dev For future use
uint256[45] private __gap;

/**
Expand Down