-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56e2dd6
commit f9da49f
Showing
23 changed files
with
612 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
PATH := ~/.solc-select/artifacts/solc-0.8.21:~/.solc-select/artifacts:$(PATH) | ||
certora-nst :; PATH=${PATH} certoraRun certora/Nst.conf$(if $(rule), --rule $(rule),) | ||
certora-nst-join :; PATH=${PATH} certoraRun certora/NstJoin.conf$(if $(rule), --rule $(rule),) | ||
certora-dai-nst :; PATH=${PATH} certoraRun certora/DaiNst.conf$(if $(rule), --rule $(rule),) | ||
certora-usds :; PATH=${PATH} certoraRun certora/Usds.conf$(if $(rule), --rule $(rule),) | ||
certora-usds-join :; PATH=${PATH} certoraRun certora/UsdsJoin.conf$(if $(rule), --rule $(rule),) | ||
certora-dai-usds :; PATH=${PATH} certoraRun certora/DaiUsds.conf$(if $(rule), --rule $(rule),) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
# NST Token and contracts associated | ||
# USDS Token and contracts associated | ||
|
||
This repository includes 3 smart contracts: | ||
|
||
- NST token | ||
- NstJoin | ||
- DaiNst Converter | ||
- USDS token | ||
- UsdsJoin | ||
- DaiUsds Converter | ||
|
||
### NST token | ||
### USDS token | ||
|
||
This is a standard erc20 implementation with regular `permit` functionality + EIP-1271 smart contract signature validation. | ||
|
||
The token uses the ERC-1822 UUPS pattern for upgradeability and the ERC-1967 proxy storage slots standard. | ||
It is important that the `NstDeploy` library sequence be used for deploying the token. | ||
It is important that the `UsdsDeploy` library sequence be used for deploying the token. | ||
|
||
#### OZ upgradeability validations | ||
|
||
The OZ validations can be run alongside the existing tests: | ||
`VALIDATE=true forge test --ffi --build-info --extra-output storageLayout` | ||
|
||
### NstJoin | ||
### UsdsJoin | ||
|
||
This is the contract in charge of `mint`ing the erc20 IOUs in exchange of native `vat.dai` balance. It also manages the reverse operation, `burn`ing tokens and releasing `vat.dai`. | ||
A noticeable code difference against `DaiJoin` is this contract doesn't have any permissions system at all. | ||
However, in practice, `NstJoin` acts the exact same way as the production `DaiJoin` implementation. This is because there isn't any `wards(address)` set there. | ||
However, in practice, `UsdsJoin` acts the exact same way as the production `DaiJoin` implementation. This is because there isn't any `wards(address)` set there. | ||
|
||
### DaiNst | ||
### DaiUsds | ||
|
||
It is a permissionless converter between `Dai` and `Nst` (both ways). Using the `public` functions of `NstJoin` and `DaiJoin` moves from one token to the other. The exchange rate is 1:1. | ||
It is a permissionless converter between `Dai` and `Usds` (both ways). Using the `public` functions of `UsdsJoin` and `DaiJoin` moves from one token to the other. The exchange rate is 1:1. | ||
It is just a "convenience" contract, users could still get the same outcome executing the separate methods in the `join`s or use any other converter implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
pragma solidity ^0.8.21; | ||
|
||
import "../src/NstJoin.sol"; | ||
import "../src/UsdsJoin.sol"; | ||
|
||
contract DaiJoinMock is NstJoin { | ||
constructor(address vat_, address dai_) NstJoin(vat_, dai_) {} | ||
contract DaiJoinMock is UsdsJoin { | ||
constructor(address vat_, address dai_) UsdsJoin(vat_, dai_) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
pragma solidity ^0.8.21; | ||
|
||
import "../src/Nst.sol"; | ||
import "../src/Usds.sol"; | ||
|
||
contract DaiMock is Nst { | ||
contract DaiMock is Usds { | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.