Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]Audit-Code4rena-2024-12: Compare the different files Without Fix #11

Open
wants to merge 40 commits into
base: audit/code4rena-fix-2024-07
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
231e88a
rename yield liquidationThreshold to collateralFactor
thorseldon Aug 29, 2024
9431903
deploy core contracts for mainnet testing
thorseldon Sep 2, 2024
352358a
add eETH price adapter
thorseldon Sep 2, 2024
c85c460
Merge branch 'feat/eeth-price-adapter' into chore/deploy-mainnet-testing
thorseldon Sep 2, 2024
f75e4e4
deploy yield contracts for mainnet testing
thorseldon Sep 2, 2024
d5afbe0
fix: calcuate liquidat price for getIsolateLiquidateData
thorseldon Sep 3, 2024
7d2736e
update scripts
thorseldon Sep 6, 2024
fd06208
add getYieldStakerAssetData
thorseldon Sep 7, 2024
de68386
add audit reports and update readme
thorseldon Sep 7, 2024
fa4807c
change the user param of yield unstake & repay event
thorseldon Sep 10, 2024
322aaf6
Merge pull request #5 from BendDAO/chore/deploy-mainnet-testing
thorseldon Sep 14, 2024
a1d7bc2
fix isolate liquidate not clear lockerAddr
thorseldon Sep 14, 2024
116492b
add sky usds for staking pool
thorseldon Oct 3, 2024
a88da2a
deploy usds on sepolia
thorseldon Oct 8, 2024
3cf0092
add pool to default irm
thorseldon Oct 8, 2024
9b4bdf5
add usds abi file
thorseldon Oct 9, 2024
cac800c
deploy usds yield on mainnet
thorseldon Oct 10, 2024
e7f5765
using proxy for default irm
thorseldon Oct 26, 2024
e2703bf
updating asset irm
thorseldon Oct 26, 2024
b87fdc5
update asset irm
thorseldon Oct 26, 2024
52f8ded
update scripts
thorseldon Oct 27, 2024
304ef0c
Merge pull request #7 from BendDAO/feat/sky-usds
thorseldon Oct 27, 2024
bf0c410
Merge branch 'main' into feat/irm-add-pool
thorseldon Oct 27, 2024
9f147d0
Merge pull request #6 from BendDAO/feat/irm-add-pool
thorseldon Oct 28, 2024
ab40210
fix compile error
thorseldon Oct 28, 2024
64d2216
update abis for irm
thorseldon Nov 1, 2024
54650df
add token oracle
thorseldon Nov 4, 2024
a0b2958
fix error code
thorseldon Nov 5, 2024
3273a39
add reentrant testcases
thorseldon Nov 11, 2024
e9faf5c
Merge pull request #8 from BendDAO/feat/add-token-oracle
thorseldon Nov 12, 2024
328258f
update defautl irm addresses
thorseldon Nov 13, 2024
eb596ea
add yield for wusd staking
thorseldon Nov 19, 2024
a3e75b2
add testcases
thorseldon Nov 19, 2024
b92e1bf
update deploy scripts
thorseldon Nov 19, 2024
ac67270
only one stake per each nft
thorseldon Nov 22, 2024
f98baab
deploy wusd staking on mainnet
thorseldon Nov 27, 2024
e38a959
add method for query stake plan
thorseldon Dec 2, 2024
5024fb2
Merge pull request #9 from BendDAO/feat/wusd-yield
thorseldon Dec 3, 2024
50fd780
fix getYieldStakerAssetData error
thorseldon Dec 5, 2024
abd0ef8
Merge branch 'main' into audit/code4rena-2024-12
thorseldon Dec 8, 2024
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
Prev Previous commit
Next Next commit
change the user param of yield unstake & repay event
thorseldon committed Sep 11, 2024
commit fa4807c8e925547042df255ec59099032584c728
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
```
###### ###### # #######
# # ###### # # ##### # # # # # #
# # # ## # # # # # # # # #
###### ##### # # # # # # # # # # #
# # # # # # # # # # ####### # #
# # # # ## # # # # # # # #
###### ###### # # ##### ###### # # #######
###### ###### # #######
# # ###### # # ##### # # # # # #
# # # ## # # # # # # # # #
###### ##### # # # # # # # # # # #
# # # # # # # # # # ####### # #
# # # # ## # # # # # # # #
###### ###### # # ##### ###### # # #######
```

# BendDAO Protocol V2
@@ -39,6 +39,7 @@ Leverage users can use ERC721 as collaterals to borrow assets to create leverage
---

## Audits

All audits are stored in the [audits](./audits/) folder and [online](https://docs.benddao.xyz/portal/v/v2/security-and-risks/audits).

---
2 changes: 1 addition & 1 deletion audits/2024-09-03-BendDAO-V2-Code4rena-Report.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[Report URL](https://code4rena.com/reports/2024-07-benddao)
[Report URL](https://code4rena.com/reports/2024-07-benddao)
7 changes: 6 additions & 1 deletion script/UpgradeContract.s.sol
Original file line number Diff line number Diff line change
@@ -32,7 +32,12 @@ contract UpgradeContract is DeployBase {
address internal addrBendV1Migration;

function _deploy() internal virtual override {
if (block.chainid == 11155111) {
if (block.chainid == 1) {
addrYieldLido = 0x61Ae6DCE4C7Cb1b8165aE244c734f20DF56efd73;
addrYieldEtherfi = 0x529a8822416c3c4ED1B77dE570118fDf1d474639;
addrYieldSDai = 0x6FA43C1a296db746937Ac4D97Ff61409E8c530cC;
addrBendV1Migration = 0xf6EE27bb3F17E456078711D8c4b257377375D654;
} else if (block.chainid == 11155111) {
addrYieldLido = 0x59303f797B8Dd80fc3743047df63C76E44Ca7CBd;
addrYieldEtherfi = 0x3234F1047E71421Ec67A576D87eaEe1B86E8A1Ea;
addrYieldSDai = 0x7464a51fA6338A34b694b4bF4A152781fb2C4B70;
4 changes: 2 additions & 2 deletions src/yield/YieldStakingBase.sol
Original file line number Diff line number Diff line change
@@ -363,7 +363,7 @@ abstract contract YieldStakingBase is Initializable, PausableUpgradeable, Reentr
accountYieldShares[address(vars.yieldAccout)] -= sd.yieldShare;
sd.yieldShare = 0;

emit Unstake(msg.sender, nft, tokenId, sd.withdrawAmount);
emit Unstake(vars.nftOwner, nft, tokenId, sd.withdrawAmount);
}

struct RepayLocalVars {
@@ -498,7 +498,7 @@ abstract contract YieldStakingBase is Initializable, PausableUpgradeable, Reentr

delete stakeDatas[nft][tokenId];

emit Repay(msg.sender, nft, tokenId, vars.nftDebt);
emit Repay(vars.nftOwner, nft, tokenId, vars.nftDebt);
}

/****************************************************************************/