Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
eyqs committed Sep 13, 2024
1 parent ad9036b commit a809733
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
13 changes: 6 additions & 7 deletions nest/script/DeployNestContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ pragma solidity ^0.8.25;
import "forge-std/Script.sol";

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Upgrades } from "openzeppelin-foundry-upgrades/Upgrades.sol";

import { AggregateTokenProxy } from "../src/proxies/AggregateTokenProxy.sol";
import { FakeComponentTokenProxy } from "../src/proxies/FakeComponentTokenProxy.sol";
import { AggregateToken } from "../src/AggregateToken.sol";
import { FakeComponentToken } from "../src/FakeComponentToken.sol";
import { AggregateTokenProxy } from "../src/proxies/AggregateTokenProxy.sol";
import { FakeComponentTokenProxy } from "../src/proxies/FakeComponentTokenProxy.sol";

contract DeployNestContracts is Script {

Expand All @@ -20,8 +19,8 @@ contract DeployNestContracts is Script {
vm.startBroadcast(ARC_ADMIN_ADDRESS);

FakeComponentToken fakeComponentToken = new FakeComponentToken();
FakeComponentTokenProxy fakeComponentTokenProxy = new fakeComponentTokenProxy(
fakeComponentToken,
FakeComponentTokenProxy fakeComponentTokenProxy = new FakeComponentTokenProxy(
address(fakeComponentToken),
abi.encodeCall(
FakeComponentToken.initialize, (ARC_ADMIN_ADDRESS, "Banana", "BAN", IERC20(USDC_ADDRESS), 18)
)
Expand All @@ -30,14 +29,14 @@ contract DeployNestContracts is Script {

AggregateToken aggregateToken = new AggregateToken();
AggregateTokenProxy aggregateTokenProxy = new AggregateTokenProxy(
aggregateToken,
address(aggregateToken),
abi.encodeCall(
AggregateToken.initialize,
(
ARC_ADMIN_ADDRESS,
"Apple",
"AAPL",
IERC20(USDC_ADDRESS),
USDC_ADDRESS,
18,
15e17,
12e17,
Expand Down
10 changes: 5 additions & 5 deletions nest/src/AggregateToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ contract AggregateToken is
* @param owner Address of the owner of the AggregateToken
* @param name Name of the AggregateToken
* @param symbol Symbol of the AggregateToken
* @param currencyToken CurrencyToken used to mint and burn the AggregateToken
* @param currencyAddress Address of the CurrencyToken used to mint and burn the AggregateToken
* @param decimals_ Number of decimals of the AggregateToken
* @param askPrice Price at which users can buy the AggregateToken using CurrencyToken, times the base
* @param bidPrice Price at which users can sell the AggregateToken to receive CurrencyToken, times the base
Expand All @@ -151,7 +151,7 @@ contract AggregateToken is
address owner,
string memory name,
string memory symbol,
IERC20 currencyToken,
address currencyAddress,
uint8 decimals_,
uint256 askPrice,
uint256 bidPrice,
Expand All @@ -165,9 +165,9 @@ contract AggregateToken is
_grantRole(UPGRADER_ROLE, owner);

AggregateTokenStorage storage $ = _getAggregateTokenStorage();
$.componentTokenMap[currencyToken] = true;
$.componentTokenList.push(currencyToken);
$.currencyToken = currencyToken;
$.componentTokenMap[IComponentToken(currencyAddress)] = true;
$.componentTokenList.push(IComponentToken(currencyAddress));
$.currencyToken = IERC20(currencyAddress);
$.decimals = decimals_;
$.askPrice = askPrice;
$.bidPrice = bidPrice;
Expand Down
4 changes: 3 additions & 1 deletion nest/src/proxies/AggregateTokenProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
* @notice Proxy contract for the AggregateToken
*/
contract AggregateTokenProxy is ERC1967Proxy {

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }
}

}
4 changes: 3 additions & 1 deletion nest/src/proxies/FakeComponentTokenProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
* @notice Proxy contract for the FakeComponentToken
*/
contract FakeComponentTokenProxy is ERC1967Proxy {

constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) { }
}

}

0 comments on commit a809733

Please sign in to comment.