-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
6 changed files
with
99 additions
and
1 deletion.
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 |
---|---|---|
@@ -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; | ||
} | ||
} |
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 |
---|---|---|
@@ -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); | ||
}); |
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 |
---|---|---|
@@ -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); | ||
}); |
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 |
---|---|---|
@@ -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); | ||
}); | ||
}); |