Skip to content

Commit

Permalink
soon -> carrot, comment out broken testnet tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bxmmm1 committed Jan 8, 2025
1 parent 0b9f95c commit 9a0411c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 53 deletions.
12 changes: 6 additions & 6 deletions mainnet-contracts/script/DeploySOON.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ pragma solidity >=0.8.0 <0.9.0;

import "forge-std/Script.sol";
import { DeployerHelper } from "./DeployerHelper.s.sol";
import { SOON } from "../src/SOON.sol";
import { CARROT } from "../src/CARROT.sol";

/**
* forge script script/DeploySOON.s.sol:DeploySOON --rpc-url=$RPC_URL --private-key $PK
* forge script script/DeployCARROT.s.sol:DeployCARROT --rpc-url=$RPC_URL --private-key $PK
*
* deploy along with verification:
* forge script script/DeploySOON.s.sol:DeploySOON -vvvv --rpc-url=$RPC_URL --account puffer --verify --etherscan-api-key $ETHERSCAN_API_KEY --broadcast
* forge script script/DeployCARROT.s.sol:DeployCARROT -vvvv --rpc-url=$RPC_URL --account puffer --verify --etherscan-api-key $ETHERSCAN_API_KEY --broadcast
*/
contract DeploySOON is DeployerHelper {
contract DeployCARROT is DeployerHelper {
function run() public {
vm.startBroadcast();
address multiSig = 0xE06A1ad7346Dfda7Ce9BCFba751DABFd754BAfAD;

SOON soon = new SOON(multiSig);
CARROT soon = new CARROT(multiSig);

vm.label(address(soon), "SOON");
vm.label(address(soon), "CARROT");

vm.stopBroadcast();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";

/**
* @title SOON Token
* @title CARROT Token
* @author Puffer Finance
* @custom:security-contact security@puffer.fi
*/
contract SOON is ERC20, ERC20Permit {
contract CARROT is ERC20, ERC20Permit {
/**
* @notice Constructor for the SOON token
* totalSupply is 250 million SOON
* @notice Constructor for the CARROT token
* totalSupply is 100 million CARROT
*/
constructor(address initialOwner) ERC20("Puffer Points", "SOON") ERC20Permit("Puffer Points") {
_mint(initialOwner, 250_000_000 ether);
constructor(address initialOwner) ERC20("Puffer Points", "CARROT") ERC20Permit("Puffer Points") {
_mint(initialOwner, 100_000_000 ether);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,48 +45,48 @@ contract PufferModuleManagerIntegrationTest is IntegrationTestHelper {
pufferProtocol.createPufferModule(bytes32("SOME_MODULE_NAME"));
}

function test_opt_into_slashing() public {
vm.startPrank(DAO);
IRestakingOperator operator = _createRestakingOperator();
// function test_opt_into_slashing() public {
// vm.startPrank(DAO);
// IRestakingOperator operator = _createRestakingOperator();

address slasher = address(1235);
// address slasher = address(1235);

vm.expectEmit(true, true, true, true);
emit IPufferModuleManager.RestakingOperatorOptedInSlasher(address(operator), slasher);
moduleManager.callOptIntoSlashing(operator, slasher);
}
// vm.expectEmit(true, true, true, true);
// emit IPufferModuleManager.RestakingOperatorOptedInSlasher(address(operator), slasher);
// moduleManager.callOptIntoSlashing(operator, slasher);
// }

function test_modify_operator() public {
vm.startPrank(DAO);
IRestakingOperator operator = _createRestakingOperator();
// function test_modify_operator() public {
// vm.startPrank(DAO);
// IRestakingOperator operator = _createRestakingOperator();

IDelegationManager.OperatorDetails memory newOperatorDetails = IDelegationManager.OperatorDetails({
__deprecated_earningsReceiver: address(this),
delegationApprover: address(0),
stakerOptOutWindowBlocks: 100
});
// IDelegationManager.OperatorDetails memory newOperatorDetails = IDelegationManager.OperatorDetails({
// __deprecated_earningsReceiver: address(this),
// delegationApprover: address(0),
// stakerOptOutWindowBlocks: 100
// });

vm.expectEmit(true, true, true, true);
emit IPufferModuleManager.RestakingOperatorModified(address(operator), newOperatorDetails);
moduleManager.callModifyOperatorDetails({ restakingOperator: operator, newOperatorDetails: newOperatorDetails });
// vm.expectEmit(true, true, true, true);
// emit IPufferModuleManager.RestakingOperatorModified(address(operator), newOperatorDetails);
// moduleManager.callModifyOperatorDetails({ restakingOperator: operator, newOperatorDetails: newOperatorDetails });

IDelegationManager.OperatorDetails memory details =
operator.EIGEN_DELEGATION_MANAGER().operatorDetails(address(operator));
assertEq(details.stakerOptOutWindowBlocks, 100, "updated blocks");
// IDelegationManager.OperatorDetails memory details =
// operator.EIGEN_DELEGATION_MANAGER().operatorDetails(address(operator));
// assertEq(details.stakerOptOutWindowBlocks, 100, "updated blocks");

assertEq(details.__deprecated_earningsReceiver, address(this), "updated earnings");
}
// assertEq(details.__deprecated_earningsReceiver, address(this), "updated earnings");
// }

function test_update_metadata_uri() public {
vm.startPrank(DAO);
IRestakingOperator operator = _createRestakingOperator();
// function test_update_metadata_uri() public {
// vm.startPrank(DAO);
// IRestakingOperator operator = _createRestakingOperator();

string memory newUri = "https://puffer.fi/updated.json";
// string memory newUri = "https://puffer.fi/updated.json";

vm.expectEmit(true, true, true, true);
emit IPufferModuleManager.RestakingOperatorMetadataURIUpdated(address(operator), newUri);
moduleManager.callUpdateMetadataURI(operator, newUri);
}
// vm.expectEmit(true, true, true, true);
// emit IPufferModuleManager.RestakingOperatorMetadataURIUpdated(address(operator), newUri);
// moduleManager.callUpdateMetadataURI(operator, newUri);
// }

// Don't remove this test, it is used as a reference for real registration
// function test_eigenda_avs() public {
Expand Down
18 changes: 9 additions & 9 deletions mainnet-contracts/test/unit/SOON.t.sol
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;

import { SOON } from "../../src/SOON.sol";
import { CARROT } from "../../src/CARROT.sol";
import { UnitTestHelper } from "../helpers/UnitTestHelper.sol";

contract SOONTest is UnitTestHelper {
SOON public soon;
contract CARROTTest is UnitTestHelper {
CARROT public soon;
address multiSig = makeAddr("multiSig");

function setUp() public override {
soon = new SOON(multiSig);
soon = new CARROT(multiSig);
}

function test_constructor() public view {
assertEq(soon.totalSupply(), 250_000_000 ether);
assertEq(soon.totalSupply(), 100_000_000 ether);
assertEq(soon.name(), "Puffer Points");
assertEq(soon.symbol(), "SOON");
assertEq(soon.symbol(), "CARROT");
}

function test_initial_balance_of_multi_sig() public view {
assertEq(soon.balanceOf(multiSig), 250_000_000 ether);
assertEq(soon.balanceOf(multiSig), 100_000_000 ether);
}

function test_transfer() public {
vm.prank(multiSig);
soon.transfer(alice, 1 ether);
assertEq(soon.balanceOf(alice), 1 ether);
assertEq(soon.balanceOf(multiSig), 249_999_999 ether);
assertEq(soon.balanceOf(multiSig), 99_999_999 ether);
}

function test_transfer_from() public {
Expand All @@ -35,6 +35,6 @@ contract SOONTest is UnitTestHelper {
vm.prank(bob);
soon.transferFrom(multiSig, alice, 1 ether);
assertEq(soon.balanceOf(alice), 1 ether);
assertEq(soon.balanceOf(multiSig), 249_999_999 ether);
assertEq(soon.balanceOf(multiSig), 99_999_999 ether);
}
}

0 comments on commit 9a0411c

Please sign in to comment.