Skip to content

Commit

Permalink
verificaton scripts + nits
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrent committed Oct 23, 2024
1 parent 61dc3d2 commit 02ec009
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions contracts/plugins/assets/DemurrageCollateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract DemurrageCollateral is FiatCollateral {
using FixLib for uint192;
using OracleLib for AggregatorV3Interface;

uint48 public constant t0 = 1704067200; // {s} Jan 1st 2024 00:00:00 GMT+0000
uint48 public constant T0 = 1704067200; // {s} Jan 1st 2024 00:00:00 GMT+0000

bool internal immutable isFiat;
bool internal immutable targetUnitFeed0; // if true: feed0 is {target/tok}
Expand Down Expand Up @@ -141,7 +141,7 @@ contract DemurrageCollateral is FiatCollateral {
function refPerTok() public view override returns (uint192) {
// Monotonically increasing due to target unit (and reference unit) deflation

uint192 denominator = FIX_ONE.minus(fee).powu(uint48(block.timestamp - t0));
uint192 denominator = FIX_ONE.minus(fee).powu(uint48(block.timestamp - T0));
if (denominator == 0) return FIX_MAX; // TODO

// up-only
Expand Down
2 changes: 2 additions & 0 deletions docs/demurrage-collateral.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ This is identical to the calculation for the `refPerTok()` function in the [Demu
weight = 1 / (1 - fee) ^ seconds;
```

`fee()` available on DemurrageCollateral contract

### Implementation

[DemurrageCollateral.sol](../contracts/plugins/assets/DemurrageCollateral.sol) implements a generalized demurrage collateral plugin that should support almost all use-cases
Expand Down
2 changes: 1 addition & 1 deletion scripts/verification/collateral-plugins/verify_arb_100.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function main() {

await verifyContract(
chainId,
assetCollDeployments.collateral.ARB,
assetCollDeployments.collateral.DMR100ARB,
[
{
erc20: networkConfig[chainId].tokens.ARB,
Expand Down
4 changes: 2 additions & 2 deletions scripts/verification/collateral-plugins/verify_cbbtc_100.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ async function main() {

const collateral = await hre.ethers.getContractAt(
'ICollateral',
assetCollDeployments.collateral.cbBTC!
assetCollDeployments.collateral.DMR100cbBTC!
)

await verifyContract(
chainId,
assetCollDeployments.collateral.cbBTC,
assetCollDeployments.collateral.DMR100cbBTC,
[
{
erc20: networkConfig[chainId].tokens.cbBTC,
Expand Down
4 changes: 2 additions & 2 deletions scripts/verification/collateral-plugins/verify_eurc_100.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ async function main() {

const collateral = await hre.ethers.getContractAt(
'ICollateral',
assetCollDeployments.collateral.EURC!
assetCollDeployments.collateral.DMR100EURC!
)

await verifyContract(
chainId,
assetCollDeployments.collateral.EURC,
assetCollDeployments.collateral.DMR100EURC,
[
{
erc20: networkConfig[chainId].tokens.EURC,
Expand Down
4 changes: 2 additions & 2 deletions scripts/verification/collateral-plugins/verify_paxg_100.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ async function main() {

const collateral = await hre.ethers.getContractAt(
'ICollateral',
assetCollDeployments.collateral.PAXG!
assetCollDeployments.collateral.DMR100PAXG!
)

await verifyContract(
chainId,
assetCollDeployments.collateral.PAXG,
assetCollDeployments.collateral.DMR100PAXG,
[
{
erc20: networkConfig[chainId].tokens.PAXG,
Expand Down

0 comments on commit 02ec009

Please sign in to comment.