- Create a
upgradable
,pausable
tokenavgprice smart contract which can be used to calculate the average price of a token (with given address).
Example: Suppose, the token price is stored on-chain everyday.
NOTE:
- You can't use any loops for adding prices like
for
,while
, etc.- You have full freedom to decide the data structure of the contract for efficient gas consumption.
- Follow GMT timestamp as day timezone for precision.
- Implement the "Diamond standard" instead of traditional proxy pattern based upgradeability methods.
- Set price for a day.
- View price on a day.
- View average token price from Aug to Sept out of 1 year data (Jan-Dec).
Before every iteration, the code has to updated & deployed by the 1st owner only in the same address with no change in the storage variables.
1st owner is the account which is used to deploy the
version-1
.
- Anyone can set everyday price of a token.
- Only Owner can set everyday price of a token.
- The price of a token on a day can be set on the same day itself.
E.g. The price for Jan 1st can be set on Jan 1st as per GMT timezone.
- Write as many possible unit tests for all three version using typescript language with Hardhat
- Openzeppelin
- Diamond standard
- Slither for finding SC vulnerabilities
- Hardhat using Typescript language.
- Include console based log inside the contract so that it is helpful for debugging.
- localhost
- Testnet
- Rinkeby
- Kovan
- Mainnet
- Ethereum
- Whether diamond standard is followed.
- Efficient code in terms of gas consumption
- Secure code: shouldn't have defi hack bugs in the contract code.
- Production code i.e use variable names by format which is used in the production codebase.
- Use solidity NATSPEC
- SC: Smart Contract