Skip to content

Commit

Permalink
Sonic Deploy 001 - Token and Vault (#2352)
Browse files Browse the repository at this point in the history
* fix incorrect type

* update hardhat-verify to support sonic chain verifications

* add descriptors of sonic 001 deploy

* remove trustee address and feeBps setting

* Prettier

---------

Co-authored-by: Domen Grabec <[email protected]>
  • Loading branch information
naddison36 and sparrowDom authored Jan 15, 2025
1 parent 4003d21 commit 081d79d
Show file tree
Hide file tree
Showing 30 changed files with 11,124 additions and 44 deletions.
15 changes: 3 additions & 12 deletions contracts/contracts/strategies/sonic/SonicValidatorDelegator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,8 @@ abstract contract SonicValidatorDelegator is InitializableAbstractStrategy {
for (uint256 i = 0; i < validatorLen; i++) {
uint256 validator = supportedValidators[i];
// Get the staked amount and any pending rewards
balance += sfc.getStake(
address(this),
validator
);
balance += sfc.pendingRewards(
address(this),
validator
);
balance += sfc.getStake(address(this), validator);
balance += sfc.pendingRewards(address(this), validator);
}
}

Expand Down Expand Up @@ -174,10 +168,7 @@ abstract contract SonicValidatorDelegator is InitializableAbstractStrategy {
// Can still undelegate even if the validator is no longer supported
require(undelegateAmount > 0, "Must undelegate something");

uint256 amountDelegated = sfc.getStake(
address(this),
validatorId
);
uint256 amountDelegated = sfc.getStake(address(this), validatorId);
require(undelegateAmount <= amountDelegated, "Insufficient delegation");

withdrawId = nextWithdrawId++;
Expand Down
26 changes: 13 additions & 13 deletions contracts/deploy/sonic/001_vault_and_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ module.exports = deployOnSonic(
signature: "setStrategistAddr(address)",
args: [strategistAddr],
},
// 9. set the trustee address
{
contract: cOSonicVault,
signature: "setTrusteeAddress(address)",
args: [strategistAddr],
},
// 10. set the trustee fee
{
contract: cOSonicVault,
signature: "setTrusteeFeeBps(uint256)",
args: [2000], // 20%
},
// 11. Set the Dripper on the Vault
// // 9. set the trustee address
// {
// contract: cOSonicVault,
// signature: "setTrusteeAddress(address)",
// args: [strategistAddr],
// },
// // 10. set the trustee fee
// {
// contract: cOSonicVault,
// signature: "setTrusteeFeeBps(uint256)",
// args: [2000], // 20%
// },
// 9. Set the Dripper on the Vault
{
contract: cOSonicVault,
signature: "setDripper(address)",
Expand Down
4 changes: 3 additions & 1 deletion contracts/deployments/sonic/.migrations.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"001_vault_and_token": 1736867284
}
387 changes: 387 additions & 0 deletions contracts/deployments/sonic/FixedRateDripper.json

Large diffs are not rendered by default.

Loading

0 comments on commit 081d79d

Please sign in to comment.