Skip to content

Commit

Permalink
Merge branch 'release/v4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerEther committed Jan 29, 2024
2 parents 5deac61 + 7f53983 commit d985d6b
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- Add MinimumAggregator: An aggregation strategy that returns the minimum price and the total token and quote token liquidity.
- Add MaximumAggregator: An aggregation strategy that returns the maximum price and the total token and quote token liquidity.

### Utils
- Add NotAnErc20: An ERC20 implementation meant to be used in Adrastia oracle contracts to provide custom quote token metadata.

## v4.1.0
### Accumulators
- Add AaveV3SBAccumulator and CometSBAccumulator
Expand Down
21 changes: 21 additions & 0 deletions contracts/utils/NotAnErc20.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity =0.8.13;

import "@openzeppelin-v4/contracts/token/ERC20/ERC20.sol";

/**
* @title NotAnErc20
* @author TRILEZ SOFTWARE INC. dba. Adrastia
* @notice An ERC20 implementation meant to be used in Adrastia oracle contracts to provide custom quote token metadata.
*/
contract NotAnErc20 is ERC20 {
uint8 internal immutable _decimals;

constructor(string memory name_, string memory symbol_, uint8 decimals_) ERC20(name_, symbol_) {
_decimals = decimals_;
}

function decimals() public view virtual override returns (uint8) {
return _decimals;
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adrastia-oracle/adrastia-core",
"version": "4.2.0-rc.1",
"version": "4.2.0",
"main": "index.js",
"author": "TRILEZ SOFTWARE INC.",
"license": "BUSL-1.1",
Expand Down
18 changes: 18 additions & 0 deletions scripts/verify/maximum-aggregation-strategy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const hre = require("hardhat");

const contractAddress = "0x92Eb6895550Fd2EFc1519De69f8b85A819A1fDC1";

async function main() {
await hre.run("verify:verify", {
contract: "contracts/strategies/aggregation/MaximumAggregator.sol:MaximumAggregator",
address: contractAddress,
constructorArguments: [],
});
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
18 changes: 18 additions & 0 deletions scripts/verify/minimum-aggregation-strategy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const hre = require("hardhat");

const contractAddress = "0x90C8E14d36bfc6ea6c871F5874eE095631d4eDC6";

async function main() {
await hre.run("verify:verify", {
contract: "contracts/strategies/aggregation/MinimumAggregator.sol:MinimumAggregator",
address: contractAddress,
constructorArguments: [],
});
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
38 changes: 38 additions & 0 deletions test/utils/not-an-erc20.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { expect } = require("chai");
const { ethers } = require("hardhat");

describe("NotAnErc20#constructor", function () {
var factory;

beforeEach(async function () {
factory = await ethers.getContractFactory("NotAnErc20");
});

it("Sets the name and symbol", async function () {
const name = "Token name";
const symbol = "TKN";

const notAnErc20 = await factory.deploy(name, symbol, 18);

expect(await notAnErc20.name()).to.equal(name);
expect(await notAnErc20.symbol()).to.equal(symbol);
});

it("Sets the decimals to 0", async function () {
const notAnErc20 = await factory.deploy("", "", 0);

expect(await notAnErc20.decimals()).to.equal(0);
});

it("Sets the decimals to 6", async function () {
const notAnErc20 = await factory.deploy("", "", 6);

expect(await notAnErc20.decimals()).to.equal(6);
});

it("Sets the decimals to 18", async function () {
const notAnErc20 = await factory.deploy("", "", 18);

expect(await notAnErc20.decimals()).to.equal(18);
});
});

0 comments on commit d985d6b

Please sign in to comment.