Skip to content

Commit

Permalink
Merge branch 'master' into psm
Browse files Browse the repository at this point in the history
  • Loading branch information
ricklista committed Nov 6, 2024
2 parents 2316367 + 3abd210 commit b180a1a
Show file tree
Hide file tree
Showing 28 changed files with 1,251 additions and 132 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on: [pull_request]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive

- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run unit tests
run: forge test -vvv
4 changes: 4 additions & 0 deletions addresses/bsc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"interaction": "0xB68443Ee3e828baD1526b3e0Bdf2Dfc6b1975ec4",
"auctionProxy": "0x272d6589CEcC19165cfCd0466f73A648cb1Ea700"
}
4 changes: 4 additions & 0 deletions addresses/bsc_testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"interaction": "0x70C4880A3f022b32810a4E9B9F26218Ec026f279",
"auctionProxy": "0xC6e80f443c56F93b2ec1b6bc8942e161dDf22716"
}
16 changes: 16 additions & 0 deletions addresses/new_collateral_SolvBTC.BBN_bsc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"symbol": "SolvBTC.BBN",
"tokenAddress": "0x1346b618dC92810EC74163e4c27004c921D446a5",
"ilk": "0x536f6c764254432e42424e000000000000000000000000000000000000000000",
"gemJoin": "0x03DB750d6212C6a0BCa9258E8cB7cf46dfD63067",
"gemJoinImplementation": "0x3e75d7edacc97645033eF8073D025069B0a0976D",
"clipper": "0xEB995ff652da728E7B0EBC31Ab543c39e054b1eA",
"clipperImplementation": "0x9B878823cF06FAC1EdB02B44eADa8bB4274AB7EA",
"oracle": "0x0AD764098FF68b100d0976a8BCF2294B67669cAa",
"oracleImplementation": "0xb35d0F744dDCD92763d37AB3c58716183a99055D",
"oracleInitializeArgs": [
"0xf3afD82A4071f272F403dC176916141f44E6c750"
],
"owner": "0xAca0ed4651ddA1F43f00363643CFa5EBF8774b37",
"proxyAdminOwner": "0x08aE09467ff962aF105c23775B9Bc8EAa175D27F"
}
16 changes: 16 additions & 0 deletions addresses/new_collateral_SolvBTC.BBN_bsc_testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"symbol": "SolvBTC.BBN",
"tokenAddress": "0x16D9A837e0D1AAC45937425caC26CcB729388C9A",
"ilk": "0x536f6c764254432e42424e000000000000000000000000000000000000000000",
"gemJoin": "0x5adABE1b1fDDFb76c3B7f3Eef9F5DDA7E4f5A347",
"gemJoinImplementation": "0x2c124E030D956F3351A2D205e757941326e3604E",
"clipper": "0xD6A5497e7dbc30a8e9f0b20686a0336B9F2fAc92",
"clipperImplementation": "0x5BA7D1c3f967c00179CE43283C06bcb374838A1D",
"oracle": "0x3e6c4Efe6D6A470439795756BEDE9f4cd6BdDd5d",
"oracleImplementation": "0x5e39f70038Db1083756ED494cf3eADfA07E49ED4",
"oracleInitializeArgs": [
"0x79e9675cDe605Ef9965AbCE185C5FD08d0DE16B1"
],
"owner": "0x05E3A7a66945ca9aF73f66660f22ffB36332FA54",
"proxyAdminOwner": "0x05E3A7a66945ca9aF73f66660f22ffB36332FA54"
}
28 changes: 15 additions & 13 deletions audits/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Helio Audits
# Lista DAO Audits

This directory the reports of audits performed on Helio smart contracts by different security firms.
This directory the reports of audits performed on Lista DAO smart contracts by different security firms.

| :warning: | Audits are not a guarantee of correctness. Some of the contracts were modified after they were audited. |
| --------- | :------------------------------------------------------------------------------------------------------ |

| Scope | Firm | Report |
|----------------|------------|------------------------------------------------|
| Ceros, Helio | Certik | [`2022-05-30`](./Certik_300522.pdf) |
| Ceros, Helio | PeckShield | [`2022-05-25`](./PeckShield_250522.pdf) |
| Helio | SlowMist | [`2022-05-10`](./SlowMist_100522.pdf) |
| Ceros | SlowMist | [`2022-05-24`](./SlowMist_240522.pdf) |
| Ceros, Helio | Veridise | [`2022-06-27`](./Veridise_270622.pdf) |
| slisBNB Oracle | PeckShield | [`2024-04-18`](./PeckShield_slisBNBOracle.pdf) |
| Multi-Oracles | PeckShield | [`2024-04-30`](./PeckShield_300424.pdf) |
| OFT | PeckShield | [`2024-06-19`](./PeckShield_190624.pdf) |
| OFT | BlockSec | [`2024-06-19`](./BlockSec_190624.pef) |
| Scope | Firm | Report |
|---------------------------------------|------------|-------------------------------------------------------|
| Ceros, Helio | Certik | [`2022-05-30`](./Certik_300522.pdf) |
| Ceros, Helio | PeckShield | [`2022-05-25`](./PeckShield_250522.pdf) |
| Helio | SlowMist | [`2022-05-10`](./SlowMist_100522.pdf) |
| Ceros | SlowMist | [`2022-05-24`](./SlowMist_240522.pdf) |
| Ceros, Helio | Veridise | [`2022-06-27`](./Veridise_270622.pdf) |
| slisBNB Oracle | PeckShield | [`2024-04-18`](./PeckShield_slisBNBOracle.pdf) |
| Multi-Oracles | PeckShield | [`2024-04-30`](./PeckShield_300424.pdf) |
| OFT | PeckShield | [`2024-06-19`](./PeckShield_190624.pdf) |
| OFT | BlockSec | [`2024-06-19`](./BlockSec_190624.pdf) |
| Emission Voting & clicBNB Launch Pool | BlockSec | [`2024-10-21`](./blocksec_emission_voting_211024.pdf) |
| Emission Voting & clicBNB Launch Pool | Salus | [`2024-10-21`](./salus_emission_voting_211024.pdf) |
Binary file added audits/blocksec_emission_voting_211024.pdf
Binary file not shown.
Binary file added audits/salus_emission_voting_211024.pdf
Binary file not shown.
47 changes: 6 additions & 41 deletions contracts/Interaction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,25 +151,6 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
hay.safeApprove(hayJoin_, type(uint256).max);
}

function setCores(address vat_, address spot_, address hayJoin_,
address jug_) public auth {
// Reset previous approval
hay.safeApprove(address(hayJoin), 0);

vat = VatLike(vat_);
spotter = SpotLike(spot_);
hayJoin = HayJoinLike(hayJoin_);
jug = JugLike(jug_);

vat.hope(hayJoin_);

hay.safeApprove(hayJoin_, type(uint256).max);
}

function setHayApprove() public auth {
hay.safeApprove(address(hayJoin), type(uint256).max);
}

function setCollateralType(
address token,
address gemJoin,
Expand Down Expand Up @@ -211,17 +192,6 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
emit CollateralDisabled(token, collaterals[token].ilk);
}

function stringToBytes32(string memory source) public pure returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}

assembly {
result := mload(add(source, 32))
}
}

function deposit(
address participant,
address token,
Expand Down Expand Up @@ -275,7 +245,7 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
(uint256 ink, uint256 art) = vat.urns(collateralType.ilk, msg.sender);
uint256 liqPrice = liquidationPriceForDebt(collateralType.ilk, ink, art);

takeSnapshot(token, msg.sender, art);
takeSnapshot(token, msg.sender, FullMath.mulDiv(art, rate, RAY));

emit Borrow(msg.sender, token, ink, hayAmount, liqPrice);
return uint256(dart);
Expand Down Expand Up @@ -314,7 +284,7 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
(uint256 ink, uint256 userDebt) = vat.urns(collateralType.ilk, msg.sender);
uint256 liqPrice = liquidationPriceForDebt(collateralType.ilk, ink, userDebt);

takeSnapshot(token, msg.sender, userDebt);
takeSnapshot(token, msg.sender, FullMath.mulDiv(userDebt, rate, RAY));

emit Payback(msg.sender, token, realAmount, userDebt, liqPrice);
return dart;
Expand Down Expand Up @@ -344,7 +314,10 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
(, uint256 userDebt) = vat.urns(collaterals[token].ilk, user);
// sync user debt only if it is greater than 0
if (userDebt > 0) {
takeSnapshot(token, user, userDebt);
CollateralType memory collateralType = collaterals[token];
_checkIsLive(collateralType.live);
(, uint256 rate,,,) = vat.ilks(collateralType.ilk);
takeSnapshot(token, user, FullMath.mulDiv(userDebt, rate, RAY));
}
}

Expand Down Expand Up @@ -612,10 +585,6 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
return ClipperLike(collaterals[token].clip).getStatus(auctionId);
}

function upchostClipper(address token) external {
ClipperLike(collaterals[token].clip).upchost();
}

function getAllActiveAuctionsForToken(address token) external view returns (Sale[] memory sales) {
return AuctionProxy.getAllActiveAuctionsForClip(ClipperLike(collaterals[token].clip));
}
Expand All @@ -624,10 +593,6 @@ contract Interaction is OwnableUpgradeable, IDao, IAuctionProxy {
AuctionProxy.resetAuction(auctionId, keeper, hay, hayJoin, vat, collaterals[token]);
}

function totalPegLiquidity() external view returns (uint256) {
return IERC20Upgradeable(hay).totalSupply();
}

function _checkIsLive(uint256 live) internal pure {
require(live != 0, "Interaction/inactive collateral");
}
Expand Down
Loading

0 comments on commit b180a1a

Please sign in to comment.