bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 15쪽 중 5쪽
,
"stateMutability"
:
"
view
"
,
"type"
:
"
function
"
},
{
"constant"
:
false
,
"inputs"
: [
{
"name"
:
"
_to
"
,
"type"
:
"
address
"
},
{
"name"
:
"
_value
"
,
"type"
:
"
uint256
"
}
],
"name"
:
"
transfer
"
,
"outputs"
: [{
"name"
:
""
,
"type"
:
"
bool
"
}],
"payable"
:
false
,
"stateMutability"
:
"
nonpayable
"
,
"type"
:
"
function
"
},
{
"constant"
:
true
,
"inputs"
: [
{
"name"
:
"
_owner
"
,
"type"
:
"
address
"
},
{
"name"
:
"
_spender
"
,
"type"
:
"
address
"
}
],
"name"
:
"
allowance
"
,
"outputs"
: [{
"name"
:
""
,
"type"
:
"
uint256
"
}],
"payable"
:
false
,
"stateMutability"
:
"
view
"
,
"type"
:
"
function
"
}
]
The contract page now shows
Read Custom
and
Write Custom
tabs you can use to interact with the OLD_MKR token.
Step 2: Check Your OLD_MKR Balance
Section titled “Step 2: Check Your OLD_MKR Balance”
Before proceeding, determine your exact OLD_MKR balance. Etherscan returns balances in wei (1 OLD_MKR = 10^18 wei).
Open
Read Custom
.
Expand
balanceOf
.
Enter your wallet address in
_owner (address)
.
Select Query.
Record the wei value returned. Example:
1563619176000000000000
(equals 1,563.619176 OLD_MKR).
Note: You must use the full wei amount in the next step.
Step 3: Approve the Redeemer Contract
Section titled “Step 3: Approve the Redeemer Contract”
This step authorizes the Redeemer contract to transfer your OLD_MKR on your behalf—a standard ERC‑20 allowance flow.
Open
Write Custom
.
Expand
approve
.
_spender (address)
:
0x642ae78fafbb8032da552d619ad43f1d81e4dd7c
(Redeemer)
_value (uint256)
: enter your exact balance (in wei) from Step 2.
Connect your wallet if needed, then select Write to submit.
Important: The Redeemer requires an allowance equal to your entire OLD_MKR balance. Partial allowances will cause
redeem()
to fail.
Wait for the approval transaction to confirm before continuing.
Step 4: Execute the Redemption
Section titled “Step 4: Execute the Redemption”
With the allowance set, execute the migration.
Open
Write Contract
on the Redeemer.
Expand
redeem
.
Connect your wallet if needed and select Write.
What happens: the Redeemer transfers your OLD_MKR from your wallet and sends you an equivalent amount of current MKR in a single transaction at a 1:1 rate.
Step 5: Verify Your MKR Balance
Section titled “Step 5: Verify Your MKR Balance”
After the redemption confirms, verify receipt of MKR:
Visit the
MKR token
on Etherscan.
Search for your wallet address.
Confirm your MKR balance matches your prior OLD_MKR amount.
Your MKR can now be upgraded to SKY.
Troubleshooting
Section titled “Troubleshooting”
Common Issues and Solutions
Section titled “Common Issues and Solutions”
Transaction Failures
Section titled “Transaction Failures”
“Insufficient allowance”:
redeem()
requires an allowance ≥ your full OLD_MKR balance. Repeat Step 3 with the full wei amount.
“Out of gas”: Increase your gas limit. Redemption typically uses 130,351 gas.
“Contract execution reverted”: Common causes include no OLD_MKR balance, an already redeemed balance, or an unconfirmed approval.
Verification Issues
Section titled “Verification Issues”
Can’t see OLD_MKR balance: Ensure the custom ABI was added correctly and that you’re querying the correct address.
MKR not visible in wallet: Add MKR by contract address
0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2
.
Next Steps
Section titled “Next Steps”
Visit the
Upgrade MKR to SKY
portal for details on upgrading MKR to SKY. Additional background is available in the
SKY Token and Governance Upgrade
guide.
Resources
Section titled “Resources”
Upgrade MKR to SKY
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/tokens/usds
USDS
USDS token is an ERC-20 compliant token with added support for permit functionality and EIP-1271 smart contract signature validation. It is designed with upgradeability in mind, using the UUPS pattern and ERC-1967 proxy storage standards.
DAI USDS converter facilitates 1:1 conversions between DAI and USDS, providing a seamless way to exchange between the two tokens without any additional restrictions.
Deployments
Section titled “Deployments”
USDS Token @ Ethereum
Section titled “USDS Token @ Ethereum”
Codebase
Deployment Addresses
DAI USDS Converter @ Ethereum
Section titled “DAI USDS Converter @ Ethereum”
Codebase
Deployment Addresses
Details
Converts DAI to USDS at a fixed ratio of 1:1 and vice versa.
No fees assessed.
Fees cannot be enabled on this route in the future.
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/tokens/susds
sUSDS (Savings USDS)
sUSDS token represents a tokenized implementation of the Sky Savings Rate for USDS, fully compliant with the ERC-4626 standard. It enables real-time share-to-asset conversions, ensuring accurate values even if the system’s drip function hasn’t been called recently. The upgradeable design follows the ERC-1822 UUPS pattern and ERC-1967 proxy storage standards, allowing flexibility for future updates.
Deployments
Section titled “Deployments”
sUSDS Token and Vault @ Ethereum
Section titled “sUSDS Token and Vault @ Ethereum”
Codebase
Deployment Addresses
Details
Contract contains an ERC20 compatible interface to allow users to view and transfer their sUSDS balances, along with Permit functionality for gas-less transfers.
Contract contains an ERC4626 compatible interface to allow users to deposit USDS to receive sUSDS or withdraw USDS with their sUSDS balance.
No fees assessed.
Fees cannot be enabled on this route in the future.
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/tokens/stusds
stUSDS (Staked USDS)
stUSDS, the first Expert token of the Sky Protocol, is a risk capital token that funds and supports liquidity for SKY stakers and structured to absorb a greater share of system risk in exchange for the potential to capture a larger portion of protocol rewards. When you supply USDS to the stUSDS module of the Protocol, you fund SKY (governance token)-backed borrowing to receive stUSDS tokens and access the stUSDS Rate. stUSDS funds and supports liquidity for SKY stakers, encouraging more participation in SKY governance, leading to a more secure ecosystem.
Deployments
Section titled “Deployments”
stUSDS Token and Vault @ Ethereum
Section titled “stUSDS Token and Vault @ Ethereum”
Codebase
Deployment Addresses
Details
Contract contains an ERC20 compatible interface to allow users to view and transfer their stUSDS balances, along with Permit functionality for gas-less transfers.
Contract contains an ERC4626 compatible interface to allow users to deposit USDS to receive stUSDS or withdraw USDS with their stUSDS balance.
Both the entry functions
deposit()
and
mint()
have an additional variant each- one is the standard 4626 function, and the other has an additional input field referral (uint16) which can be ignored.
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/tokens/sky
SKY
SKY token is an ERC-20 token with permit functionality and EIP-1271 signature validation.
MKR SKY Converter enables two-way conversions between MKR and SKY tokens, utilizing the mint and burn functions of both tokens. The exchange rate is fixed at 1:24000. However, if minting capabilities are removed from either token, conversion for that token will no longer be possible. Additionally, converting MKR to SKY may result in small amounts being lost if the amount is not a multiple of the conversion rate.
Deployments
Section titled “Deployments”
SKY Token @ Ethereum
Section titled “SKY Token @ Ethereum”
Codebase
Deployment Addresses
MKR SKY Converter @ Ethereum
Section titled “MKR SKY Converter @ Ethereum”
Codebase
Deployment Addresses
Details
Converts MKR to SKY at a fixed ratio of 1:24000 and vice versa.
No fees assessed.
Fees cannot be enabled on this route in the future.
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/tokens/dai
Dai
The origin of DAI was designed to represent any token that the core system considers equal in value to its internal debt unit. Thus, the
DAI Module
contains the DAI token contract and all of the adapters DaiJoin adapters.
The
Dai
contract is the user-facing ERC20 token contract maintaining the accounting for external Dai balances. Most functions are standard for a token with changing supply, but it also notably features the ability to issue approvals for transfers based on signed messages.
Key Mechanism and Concepts
Section titled “Key Mechanism and Concepts”
Why are these components important to the Multi-Collateral Dai (MCD) System?
Section titled “Why are these components important to the Multi-Collateral Dai (MCD) System?”
The
Dai
contract is the user facing ERC20 contract maintaining the accounting for external Dai balances. Most functions are standard for a token with changing supply, but it also notably features the ability to issue approvals for transfers based on signed messages.
Join
consists of three smart contracts, one of which is the DaiJoin contract. Each join contract is created specifically to allow the given token type to be joined to the vat. Because of this, each join contract has slightly different logic to account for the different types of tokens within the system. The DaiJoin contract allows users to withdraw their Dai from the system into a standard ERC20 token.
Differences From ERC20:
Section titled “Differences From ERC20:”
transferFrom
in the DAI contract works in a slightly different form than the generic
transferFrom
function. The DAI contract allows for “unlimited approval”. Should the user approve an address for the maximum uint256 value, then that address will have unlimited approval until told otherwise.
push
,
pull
&
move
are aliases for
transferFrom
calls in the form of
transferFrom(msg.sender, usr, amount)
,
transferFrom(usr, msg.sender, amount)
&
transferFrom(src, dst, amount)
.
permit
is a signature-based approval function. This allows for an end-user to sign a message which can then be relayed by another party to submit their approval. This can be useful for applications in which the end-user does not need to hold
ETH
.
In order to use this functionality, a user’s address must sign a message with the
holder
,
spender
,
nonce
,
expiry
and the
allowed
amount. This can then be submitted to
Permit()
to update the user’s approval.
Built-in meta-transaction functionality of Dai
Section titled “Built-in meta-transaction functionality of Dai”
The Dai token provides offchain approval, which means that as an owner of an ETH address, you can sign a permission (using the permit() function) which basically grants allowance to another ETH address. The ETH address that you provide permission to can then take care of the execution of the transfer but has an allowance.
Gotchas (Potential sources of user error)
Section titled “Gotchas (Potential sources of user error)”
Unlimited allowance is a relatively uncommon practice (though becoming more common). This could be something used to trick a user by a malicious contract into giving access to all their DAI. This is concerning in upgradeable contracts where the contract may appear innocent until upgraded to a malicious contract.
DAI is also susceptible to the known
ERC20 race condition
, but should not normally be an issue with unlimited approval. We recommend any users using the
approval
for a specific amount be aware of this particular issue and use caution when authorizing other contracts to perform transfers on their behalf.
There is a slight deviation in
transferFrom
functionality: If the
src == msg.sender
the function does not require
approval
first and treats it as a normal
transfer
from the
msg.sender
to the
dst
.
Failure Modes (Bounds on Operating Conditions & External Risk Factors)
Section titled “Failure Modes (Bounds on Operating Conditions & External Risk Factors)”
There could potentially be a
vat
upgrade that would require new
join
contracts to be created.
If a
gem
contract were to go through a token upgrade or have the tokens frozen while a user’s collateral was in the system, there could potentially be a scenario in which the users were unable to redeem their collateral after the freeze or upgrade was finished. This seems to be a small risk though because it would seem likely that the token going through this upgrade would want to work alongside the Sky community to be sure this was not an issue.
Contract Details
Section titled “Contract Details”
Glossary (DAI)
Section titled “Glossary (DAI)”
Key Functionalities (as defined in the smart contract)
Mint
- Mint to an address
Burn
- Burn at an address
Push
- Transfer
Pull
- Transfer From
Move
- Transfer From
Approve
- Allow pulls and moves
Permit
- Approve by signature
Other
name
- Dai Stablecoin
symbol
- DAI
version
- 1
decimals
- 18
totalSupply
- Total DAI Supply
balanceOf(usr: address)
- User balance
allowance(src: address, dst: address)
- Approvals
nonces(usr: address)
- Permit nonce
Glossary (Join)
Section titled “Glossary (Join)”
vat
- storage of the Vat’s address
ilk
- id of the Ilk for which a
GemJoin
is created for
gem
- the address of the
ilk
for transferring
dai
- the address of the
dai
token
one
- a 10^27 uint used for math in
DaiJoin
wad
- fixed point decimal with 18 decimals (for basic quantities, e.g. balances).
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/rewards/staking-rewards
Staking Rewards
Codebase
Deployment Addresses
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/rewards/staking-engine
Staking Engine (LockStake Engine)
The LockStake Engine allows users to deposit SKY and open a vault position, which can be used for one or more of the following purposes:
Borrow USDS using the deposited SKY as collateral.
Stake the entire SKY deposit in the vault to earn rewards from any one of multiple available options.
Delegate the voting power of the entire SKY deposit in the vault to a governance delegate. Users can open one or more vaults from a single address to gain greater flexibility in borrowing, staking, and delegating using the SKY they hold.
Deployments
Section titled “Deployments”
LockStake Engine (Staking Engine) @ Ethereum
Section titled “LockStake Engine (Staking Engine) @ Ethereum”
Codebase
Deployment Addresses
Details
Users can approve other addresses to perform actions on their SKY vault.
The LockStake Engine deposits the LSSKY token balance held by the user’s vault (urn) into their selected staking rewards contracts. However, users cannot directly handle or transfer this LSSKY balance.
Users cannot transfer their SKY vault (urn) to another address.
Released into the public domain (CC0 1.0 Universal)
– trademarks remain with their owners; no warranty. See
full license
.
## /protocol/core/vat
Vat (Core Accounting)
The
Vat
is the core Vault engine of
dss
. It stores Vaults and tracks all the associated Dai and Collateral balances. It also defines the rules by which Vaults and balances can be manipulated. The rules defined in the
Vat
are immutable, so in some sense, the rules in the
Vat
can be viewed as the constitution of
dss
. The
Vat
contract has no external dependencies and maintains the central “Accounting Invariants” of Dai.
Mechanisms & Concepts
Section titled “Mechanisms & Concepts”
The core Vault, Dai, and collateral state is kept in the
Vat
. The
Vat
contract has no external dependencies and maintains the central “Accounting Invariants” of Dai. The core principles that apply to the
vat
are as follows:
Dai cannot exist without collateral:
An
ilk
is a particular type of collateral.
Collateral
gem
is assigned to users with
slip
.
Collateral
gem
is transferred between users with
flux
.
The Vault data structure is the
Urn
:
has
ink
- encumbered collateral
has
art
- encumbered, normalized debt
Similarly, a collateral is an
Ilk
:
has
Art
- encumbered, normalized debt
has
rate
- debt scaling factor (discussed further below)
has
spot
- price with safety margin
has
line
- debt ceiling
has
dust
- debt floor
Note:
Above, when using the term “encumbered”, this refers to being “locked in a Vault”.
Vault Management
Section titled “Vault Management”
Vaults are managed via
frob(i, u, v, w, dink, dart)
, which modifies the Vault of user
u
, using
gem
from user
v
and creating
dai
for user
w
.
Vaults are confiscated via
grab(i, u, v, w, dink, dart)
, which modifies the Vault of user
u
, giving
gem
to user
v
and creating
sin
for user
w
.
grab
is the means by which Vaults are liquidated, transferring debt from the Vault to a users
sin
balance.
Sin represents “seized” or “bad” debt and can be canceled out with an equal quantity of Dai using
heal(uint rad
where
msg.sender
is used as the address for the
dai
and
sin
balances.
Note:
Only the Vow will ever have
sin
, so only the Vow can successfully call
heal
. This is because whenever
grab
and
suck
are called, the Vow’s address is passed as the recipient of
sin
. Note that this is contingent on the current design and implementation of the system.
Note:
heal
can only be called with a positive number (uint) and will
sub(dai[u])
along with
sub
ing the
sin
.
The quantity
dai
can be transferred between users with
move
.
Rate Updates via
fold(bytes32 ilk, address u, int rate)
An ilk’s
rate
is the conversion factor between any normalized debt (
art
) drawn against it and the present value of that debt with accrued fees. The
rate
parameter to
fold
is actually the change in the
Ilk.rate
value, i.e. a difference of scaling factors (new - old). It is a signed integer, and hence current account values may increase or decrease. The quantity
Ilk.Art*rate
is added to the
dai
balance of the address
u
(representing an increase or decrease in system surplus); the debt balances of all Vaults collateralized with the specified
Ilk
are updated implicitly via the addition of
rate
to
Ilk.rate
.
Gotchas
Section titled “Gotchas”
The methods in the
Vat
are written to be as generic as possible and as such have interfaces that can be quite verbose. Care should be taken that you have not mixed the order of parameters.
Any module that is
auth
ed against the
Vat
has full root access, and can therefore steal all collateral in the system. This means that the addition of a new collateral type (and associated adapter) carries considerable risk.
Failure Modes
Section titled “Failure Modes”
Coding Error
Section titled “Coding Error”
A bug in the
Vat
could be catastrophic and could lead to the loss (or locking) of all Dai and Collateral in the system. It could become impossible to modify Vault’s or to transfer Dai. Auctions could cease to function. Shutdown could fail.
Feeds
Section titled “Feeds”
The
Vat
relies upon a set of trusted oracles to provide price data. Should these price feeds fail, it would become possible for unbacked Dai to be minted, or safe Vaults could be unfairly liquidated.
Governance
Section titled “Governance”
Sky Ecosystem Governance can authorize new modules against the
Vat
. This allows them to steal collateral (
slip
) or mint unbacked Dai (
suck
/ addition of worthless collateral types). Should the cryptoeconomic protections that make프로젝트로 돌아가기