bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 16쪽 중 15쪽
m my loan?
What if I forget to roll my loan, is there a grace period before defaulting?
I accidentally defaulted, can I recover my collateral?
If other users repay their loans, will that increase the capacity available in the clearinghouse?
Do Cooler Loans increase OHM supply?
What happens to the defaulted gOHM?
What happens with the collected interest payments?
Can a user vote with their Cooler collateral?
Contracts
## /main/legacy/migration
On this page
V2 Migration
Why do I need to migrate?
V2 migration introduces new features such as on-chain governance and auto-staking for bonds.
Transitioning from sOHM V1 to gOHM allows for multiple bonds to be taken at one time, as opposed to one bond per vesting period as it was in v1.
Partial liquidity will remain for v1 OHM while the migration is in progress. This provides sufficient liquidity for borrowers to close or move their borrowing position.
You can read more about this on the
Olympus Medium page
.
note
For this article, we added V1 and V2 after each token name to help you differentiate between the old and new tokens. Partner websites, price aggregators, or your wallet will not display the version information.
What is the TLDR?
wsOHM V1 (wrapped, staked OHM) will be replaced by gOHM (Governance OHM). They function exactly the same, but gOHM is set up for on-chain governance.
OHM and sOHM tokens will have their identical V2 counterparts. OHM V1 becomes OHM V2, and sOHM V1 becomes sOHM V2.
Token tickers will remain the same for V1 tokens. For example, after migration, your wallet will show "OHM" instead of "OHM V1". Make sure to update the token contract in your wallet with the
V2 addresses
to show your balances.
When migrating OHM V1 and/or sOHM V1, you will get gOHM in return. Although the token balance will be different (gOHM price is calculated differently, which is based on the Current Index), the
dollar amount remains the same.
After the migration, OHM V1 pools such as OHM-DAI will utilize OHM V2. This applies to new bonds as well. Partners like Abracadabra will only accept new deposits in gOHM. So, you will need to migrate if you want to use these features.
Otherwise, you can sit tight and migrate only when you want to.
What if I don't migrate?
You don't get to enjoy the new features introduced by V2. Some partners such as Rari Capital will only accept V2 tokens once they are deployed, so you would need to migrate if you want to spend more tokens (e.g. make new deposits) on these platforms.
note
You would not miss any rebase rewards if you don't migrate. Even if you chose to migrate at a later time, you will receive the same amount of gOHM that you would have received had you migrated immediately.
Gas fees are high now, will I lose my rebase rewards if I delay the migration?
No, you can migrate at your leisure once it goes live. The smart contract will keep track of your entitled rebase rewards so you wouldn't miss any of them.
What is the migration process?
When the migration is live, the Olympus front-end will be updated to allow the migration of all your V1 tokens (i.e. OHM, sOHM, and wsOHM) to gOHM.
The migration process requires two steps: one to approve the contract for each of your V1 tokens, and another that actually migrates all your tokens to gOHM.
note
Each V1 token type requires its own approval step. For example, if you have OHM V1 and sOHM V1 in your wallet, you need to perform two token approvals, but only one migration operation (three transactions in total).
Can I migrate a specific type of V1 token and leave out the others?
No. You can either migrate all your V1 tokens (i.e. OHM, sOHM, and wsOHM) or none at all.
Can I switch back to V1 tokens after migrating them to gOHM?
No, you can't switch back from gOHM to V1 tokens through our migration tool.
How much gOHM can I expect from the migration?
The Index at the time of migration was
46.721314322
and will be used for the migration.
For OHM v1 and sOHM v1 the amount of gOHM you will receive is
(amount of [s]OHM v1) / 46.721314322
.\
So if you have 10 OHM or sOHM you will receive
10 / 46.721314322
→
0.214035074678779
gOHM.\
That gOHM will be worth much more (s)OHM v2 than you had (s)OHM v1 because it accounts for missing rewards.
For wsOHM you will receive exactly the same amount in gOHM.\
So if you have 0.5 wsOHM you will receive 0.5 gOHM.
note
As a reminder, if you're migrating from a non-index-based token (OHM, sOHM) to an index-based token (gOHM), you won't receive the same amount of tokens after the migration, but they still worth the same in dollar term.
Will my gOHM still earn rebase rewards?
Yes. Although gOHM does not change in quantity upon rebase like sOHM does, it still earns you rebase rewards. This is because the price of gOHM is tied to the Current Index:
g
O
H
M
p
r
i
c
e
=
O
H
M
p
r
i
c
e
∗
C
u
r
r
e
n
t
I
n
d
e
x
gOHM_{price} = OHM_{price} * CurrentIndex
g
O
H
M
p
r
i
ce
=
O
H
M
p
r
i
ce
∗
C
u
r
r
e
n
t
I
n
d
e
x
Every rebase event will cause the Current Index to go up, and your gOHM is worth more as a result (provided that OHM's price stays constant).
How are bonds affected after the migration?
In V2, you can purchase multiple bonds of the same type without resetting the bond vesting period.
Also, there is no need to claim bond rewards and stake them manually, as this process will be automated. The bonders will receive their entitled sOHM at the end of the vesting period.
Learn more about how bonds will behave in V2 from the
Olympus Medium page
.
Is Olympus V2 audited?
All V2-related contracts are live, and some of them are still under audit process. We are working with Runtime Verification for the audit, and the results will be published once they become available.
How to Wrap sOHM to gOHM
gOHM
will be the first v2 token to roll out. Users
can wrap their v1 sOHM tokens into gOHM tokens as part of the v2 migration.
Go to the
Wrap section of Olympus App
.
Select gOHM under the drop-down menu.
If this is your first time wrapping sOHM, you need to approve the smart contract
to use your token. Click "Approve" and confirm the transaction on your wallet.
After the approval transaction is confirmed, enter the amount of sOHM that
you wish to wrap. You can also hit "Max" for the full amount. Then, click "Wrap"
and sign the transaction.
When the wrap transaction is confirmed, your gOHM balance will be updated.
Please add the
gOHM token contract
to your wallet
if you can't see it.
How to Migrate to V2
info
The old TokenMigrator contract has been defunded and is no longer functional. Migration is now handled by the
V1Migrator policy
, which uses an allowlist system.
With the V1Migrator policy, eligible users can migrate their OHM v1 tokens to OHM v2.
To migrate:
Check if you are eligible for migration through the Olympus app or governance announcements.
Go to the
Stake section of Olympus App
to access the migration tool.
Approve the migration contract to transfer your OHM v1 tokens.
Execute the migration. The frontend will handle the allowlist verification automatically.
You will receive OHM v2 directly—no additional steps required.
note
Only users on the allowlist can migrate. Contact the Olympus team on Discord if you believe you should be eligible.
Why do I need to migrate?
What is the TLDR?
What if I don't migrate?
Gas fees are high now, will I lose my rebase rewards if I delay the migration?
What is the migration process?
Can I migrate a specific type of V1 token and leave out the others?
Can I switch back to V1 tokens after migrating them to gOHM?
How much gOHM can I expect from the migration?
Will my gOHM still earn rebase rewards?
How are bonds affected after the migration?
Is Olympus V2 audited?
How to Wrap sOHM to gOHM
How to Migrate to V2
## /main/contracts/docs/src
Src
bases
external
interfaces
libraries
modules
periphery
policies
proposals
Actions
Instruction
Permissions
Keycode
TargetNotAContract
InvalidKeycode
KernelAdapter
Module
Policy
Kernel
toKeycode
fromKeycode
ensureValidKeycode
ensureContract
SubKeycode
InvalidSubKeycode
ModuleWithSubmodules
Submodule
ensureValidSubKeycode
fromSubKeycode
toSubKeycode
## /main/contracts/docs/src/bases
Bases
interfaces
BaseAssetManager
BasePeriodicTaskManager
## /main/contracts/docs/src/bases/interfaces
Interfaces
IAssetManager
IPeriodicTaskManager
## /main/contracts/docs/src/bases/interfaces/IAssetManager.sol/interface.IAssetManager
On this page
IAssetManager
Git Source
Title:
IAssetManager
This interface defines the functions for custodying assets.
A depositor can deposit assets into a vault, and withdraw them later.
An operator is the contract that acts on behalf of the depositor. Only operators can interact with the contract. The deposits facilitated by an operator are siloed from other operators.
Functions
getOperatorAssets
Get the number of assets deposited for an asset and operator
function
getOperatorAssets
(
IERC20 asset_
,
address
operator_
)
external
view
returns
(
uint256
shares
,
uint256
sharesInAssets
)
;
Parameters
Name
Type
Description
asset_
IERC20
The asset to get the deposited shares for
operator_
address
The operator to get the deposited shares for
Returns
Name
Type
Description
shares
uint256
The number of shares deposited
sharesInAssets
uint256
The number of shares deposited (in terms of assets)
getAssetConfiguration
Get the configuration for an asset
function
getAssetConfiguration
(
IERC20 asset_
)
external
view
returns
(
AssetConfiguration
memory
configuration
)
;
Parameters
Name
Type
Description
asset_
IERC20
The asset to get the configuration for
Returns
Name
Type
Description
configuration
AssetConfiguration
The configuration for the asset
getConfiguredAssets
Get the assets that are configured
function
getConfiguredAssets
(
)
external
view
returns
(
IERC20
[
]
memory
assets
)
;
Returns
Name
Type
Description
assets
IERC20[]
The assets that are configured
Events
AssetConfigured
event
AssetConfigured
(
address
indexed
asset
,
address
indexed
vault
)
;
AssetDepositCapSet
Emitted when an asset's deposit cap is updated
event
AssetDepositCapSet
(
address
indexed
asset
,
uint256
depositCap
)
;
Parameters
Name
Type
Description
asset
address
The ERC20 asset
depositCap
uint256
The new deposit cap amount (in asset units)
AssetMinimumDepositSet
Emitted when an asset's minimum single-deposit amount is updated
event
AssetMinimumDepositSet
(
address
indexed
asset
,
uint256
minimumDeposit
)
;
Parameters
Name
Type
Description
asset
address
The ERC20 asset
minimumDeposit
uint256
The new minimum deposit amount (in asset units)
AssetDeposited
event
AssetDeposited
(
address
indexed
asset
,
address
indexed
depositor
,
address
indexed
operator
,
uint256
amount
,
uint256
shares
)
;
AssetWithdrawn
event
AssetWithdrawn
(
address
indexed
asset
,
address
indexed
withdrawer
,
address
indexed
operator
,
uint256
amount
,
uint256
shares
)
;
Errors
AssetManager_NotConfigured
error
AssetManager_NotConfigured
(
)
;
AssetManager_InvalidAsset
error
AssetManager_InvalidAsset
(
)
;
AssetManager_AssetAlreadyConfigured
error
AssetManager_AssetAlreadyConfigured
(
)
;
AssetManager_VaultAssetMismatch
error
AssetManager_VaultAssetMismatch
(
)
;
AssetManager_ZeroAmount
error
AssetManager_ZeroAmount
(
)
;
AssetManager_DepositCapExceeded
error
AssetManager_DepositCapExceeded
(
address
asset
,
uint256
existingDepositAmount
,
uint256
depositCap
)
;
AssetManager_MinimumDepositNotMet
error
AssetManager_MinimumDepositNotMet
(
address
asset
,
uint256
depositAmount
,
uint256
minimumDeposit
)
;
AssetManager_MinimumDepositExceedsDepositCap
error
AssetManager_MinimumDepositExceedsDepositCap
(
address
asset
,
uint256
minimumDeposit
,
uint256
depositCap
)
;
Structs
AssetConfiguration
Configuration for an asset
struct
AssetConfiguration
{
bool
isConfigured
;
uint256
depositCap
;
uint256
minimumDeposit
;
address
vault
;
}
Properties
Name
Type
Description
isConfigured
bool
Whether the asset is configured
depositCap
uint256
The maximum amount of assets that can be deposited. Set to 0 to disable deposits.
minimumDeposit
uint256
The minimum amount of assets that can be deposited in a single transaction (set to 0 to disable the check)
vault
address
The ERC4626 vault that the asset is deposited into
Functions
getOperatorAssets
getAssetConfiguration
getConfiguredAssets
Events
AssetConfigured
AssetDepositCapSet
AssetMinimumDepositSet
AssetDeposited
AssetWithdrawn
Errors
AssetManager_NotConfigured
AssetManager_InvalidAsset
AssetManager_AssetAlreadyConfigured
AssetManager_VaultAssetMismatch
AssetManager_ZeroAmount
AssetManager_DepositCapExceeded
AssetManager_MinimumDepositNotMet
AssetManager_MinimumDepositExceedsDepositCap
Structs
AssetConfiguration
## /main/contracts/docs/src/bases/interfaces/IPeriodicTaskManager.sol/interface.IPeriodicTaskManager
On this page
IPeriodicTaskManager
Git Source
Title:
IPeriodicTaskManager
Interface for a contract that can manage periodic tasks with ordering capabilities
Functions
addPeriodicTask
Adds a periodic task to the end of the task list
This function should be protected by a role check for the "admin" role
function
addPeriodicTask
(
address
task_
)
external
;
Parameters
Name
Type
Description
task_
address
The periodic task to add
addPeriodicTaskAtIndex
Adds a periodic task at a specific index in the task list
This function should be protected by a role check for the "admin" role
If the index is greater than the current length, the task will be added at the end
function
addPeriodicTaskAtIndex
(
address
task_
,
bytes4
customSelector_
,
uint256
index_
)
external
;
Parameters
Name
Type
Description
task_
address
The periodic task to add
customSelector_
bytes4
The custom selector to use for the task (or 0)
index_
uint256
The index where to insert the task
removePeriodicTask
Removes a periodic task from the task list
This function should be protected by a role check for the "admin" role
function
removePeriodicTask
(
address
task_
)
external
;
Parameters
Name
Type
Description
task_
address
The periodic task to remove
removePeriodicTaskAtIndex
Removes a periodic task at a specific index
This function should be protected by a role check for the "admin" role
function
removePeriodicTaskAtIndex
(
uint256
index_
)
external
;
Parameters
Name
Type
Description
index_
uint256
The index of the task to remove
getPeriodicTaskCount
Gets the total number of periodic tasks
function
getPeriodicTaskCount
(
)
external
view
returns
(
uint256
_taskCount
)
;
Returns
Name
Type
Description
_taskCount
uint256
The number of periodic tasks
getPeriodicTaskAtIndex
Gets a periodic task at a specific index
function
getPeriodicTaskAtIndex
(
uint256
index_
)
external
view
returns
(
address
_task
,
bytes4
_customSelector
)
;
Parameters
Name
Type
Description
index_
uint256
The index of the task to get
Returns
Name
Type
Description
_task
address
The address of the periodic task at the specified index
_customSelector
bytes4
The custom selector for the task (or 0)
getPeriodicTasks
Gets all periodic tasks
function
getPeriodicTasks
(
)
external
view
returns
(
address
[
]
memory
_tasks
,
bytes4
[
]
memory
_customSelectors
)
;
Returns
Name
Type
Description
_tasks
address[]
An array of all periodic tasks in order
_customSelectors
bytes4[]
An array of all custom selectors in order
getPeriodicTaskIndex
Gets the index of a specific periodic task
function
getPeriodicTaskIndex
(
address
task_
)
external
view
returns
(
uint256
_index
)
;
Parameters
Name
Type
Description
task_
address
The periodic task to find
Returns
Name
Type
Description
_index
uint256
The index of the task, or type(uint256).max if not found
hasPeriodicTask
Checks if a periodic task exists in the manager
function
hasPeriodicTask
(
address
task_
)
external
view
returns
(
bool
_exists
)
;
Parameters
Name
Type
Description
task_
address
The periodic task to check
Returns
Name
Type
Description
_exists
bool
True if the task exists, false otherwise
Events
PeriodicTaskAdded
Emitted when a periodic task is added
event
PeriodicTaskAdded
(
address
indexed
task_
,
bytes4
customSelector_
,
uint256
indexed
index_
)
;
Parameters
Name
Type
Description
task_
address
The address of the periodic task
customSelector_
bytes4
index_
uint256
The index where the task was added
PeriodicTaskRemoved
Emitted when a periodic task is removed
event
PeriodicTaskRemoved
(
address
indexed
task_
,
uint256
indexed
index_
)
;
Parameters
Name
Type
Description
task_
address
The address of the periodic task
index_
uint256
The index where the task was removed from
Errors
PeriodicTaskManager_TaskNotFound
Error thrown when trying to remove a task that doesn't exist
error
PeriodicTaskManager_TaskNotFound
(
address
task_
)
;
PeriodicTaskManager_TaskAlreadyExists
Error thrown when trying to add a task that already exists
error
PeriodicTaskManager_TaskAlreadyExists
(
address
task_
)
;
PeriodicTaskManager_ZeroAddress
Error thrown when the provided task address is zero
error
PeriodicTaskManager_ZeroAddress
(
)
;
PeriodicTaskManager_NotPeriodicTask
Error thrown when the provided task does not implement the IPeriodicTask interface
error
PeriodicTaskManager_NotPeriodicTask
(
address
task_
)
;
PeriodicTaskManager_CustomSelectorFailed
Error thrown when a custom selector fails
error
PeriodicTaskManager_CustomSelectorFailed
(
address
task_
,
bytes4
customSelector_
,
bytes
reason_
)
;
Functions
addPeriodicTask
addPeriodicTaskAtIndex
removePeriodicTask
removePeriodicTaskAtIndex
getPeriodicTaskCount
getPeriodicTaskAtIndex
getPeriodicTasks
getPeriodicTaskIndex
hasPeriodicTask
Events
PeriodicTaskAdded
PeriodicTaskRemoved
Errors
PeriodicTaskManager_TaskNotFound
PeriodicTaskManager_TaskAlreadyExists
PeriodicTaskManager_ZeroAddress
PeriodicTaskManager_NotPeriodicTask
PeriodicTaskManager_CustomSelectorFailed
## /main/contracts/docs/src/bases/BaseAssetManager.sol/abstract.BaseAssetManager
On this page
BaseAssetManager
Git Source
Inherits:
IAssetManager
Title:
BaseAssetManager
This is a base contract for managing asset deposits and withdrawals. It is designed to be inherited by another contract.
This contract supports multiple assets, and can store them idle or in an ERC4626 vault (specified at the time of configuration). Once an approach is specified, it cannot be changed. This is to avoid the threat of a governance attack that shifts the deposited funds to a different vault in order to steal them.
Future versions of the contract could add support for more complex strategies and/or strategy migration, while addressing the concern of funds theft.
State Variables
_
configuredAssets
Array of configured assets
IERC20
[
]
internal
_configuredAssets
_
assetConfigurations
Mapping of assets to a configuration
mapping
(
IERC20 asset
=>
AssetConfiguration
)
internal
_assetConfigurations
_
operatorShares
Mapping of assets and operators to the number of shares they have deposited
mapping
(
bytes32
operatorKey
=>
uint256
shares
)
internal
_operatorShares
Functions
_
depositAsset
Deposit assets into the configured vault
This function will pull the assets from the depositor and deposit them into the vault. If the vault is the zero address, the assets will be kept idle.
To avoid susceptibility to ERC777 re-entrancy, this function should be called before any state changes.
When an ERC4626 vault is configured for an asset, the amount of assets that can be withdrawn may be 1 less than what was originally deposited. To be conservative, this function returns the actual amount.
This function will revert if:
The vault is not approved
It is unable to pull the assets from the depositor
The minimum deposit requirement is not met
Adding the deposit would exceed the deposit cap
Zero shares would be received from the vault
function
_depositAsset
(
IERC20 asset_
,
address
deposito프로젝트로 돌아가기