Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 4 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Aldex Contracts

## Old repo (contains issues/releases that were not migrated)

[Previous repo](https://github.com/alpaca-finance/aldex-contracts)

## Get Started

[Environment setup](https://alpacafinance.atlassian.net/wiki/spaces/ALDEX/pages/9109505/Environment+setup)
Expand Down Expand Up @@ -28,42 +32,3 @@
- x - Major (protocol api significant change, for example when a roadmap milestone acomplished)
- y - Minor (may have some minor api changes and deployment script changes)
- z - Patch (bugfix/optimization that doesn't affect deployment script/api)

NOTE: In an agile development we will do at least one Patch-level release each sprint.

### How to Deploy Aldex Contracts on FORK

important
```
use .mainnet.empty.json as initial file to update contracts information while deploy

define env value

FORK_RPC_URL=<fork rpc url>
IMPERSONATE_ACCOUNT=<impersonate address>
```

note
```
if found `failed ProviderError: resource not found` try remove `.mainnet.json` in `.openzeppelin`
```

1. run `yarn compile` if contracts is already compiled with stabled code, you can skip this step
2. run `yarn deploy:aldex-core`\
deploy Libraries, AldexDeployer, AldexBank, Ausd, AldexBankConfig, ConcentratedLiquidityPoolFactory, etc..
3. run `yarn deploy:oracle`\
deploy ChainlinkPriceOracle, OracleChecker, setChainlinkPriceOracle on AldexBankConfig, setOracleChecker on AldexBank
4. run `yarn deploy:strategy-outside-swap`\
deploy UniswapV3StrategyOutsideSwap and whitelist on AldexBank
5. run `yarn deploy:concentrated-pool`\
deploy cl pools with custom inputs variable inside `concentrated-liquidity-pool.ts`
6. run `yarn deploy:concentrated-pool-helper`

### How to set config on contract

7. run `yarn config:set-oracle-checker-config`\
set expired time and tolerance bps per token
8. run `yarn config:set-oracle-prices`\
set price via chainlink address per token
9. run `yarn config:update-ausd-max-debt-limit`
set max debt per token on AldexBank
22 changes: 22 additions & 0 deletions contracts/v0.8.17/extras/ERC20FakeToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { ERC20 } from "../../../lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";

contract FakeERC20 is ERC20 {
address private owner;

constructor(string memory name, string memory symbol) ERC20(name, symbol) {
owner = _msgSender();
}

function mint(address _to, uint256 _amount) external {
require(_msgSender() == owner, "Security violation");
_mint(_to, _amount);
}

function burn(address _account, uint256 _amount) external {
require(_msgSender() == owner, "Security violation");
_burn(_account, _amount);
}
}
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const config: HardhatUserConfig = {
"tests",
"pool",
"strategies",
"extras",
],
},
solidity: {
Expand Down