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

Proposal script #50

Merged
merged 37 commits into from
Feb 15, 2024
Merged

Proposal script #50

merged 37 commits into from
Feb 15, 2024

Conversation

alexkeating
Copy link
Collaborator

Description

  • Create script to change the v3 factory owner and enable protocol fees for specific pools.

Closes #25

@alexkeating alexkeating changed the base branch from feature/add-deploy-script to main February 7, 2024 19:15
@alexkeating alexkeating force-pushed the feature/proposal-script branch 2 times, most recently from 8965936 to e5dd3d8 Compare February 7, 2024 19:18
@alexkeating alexkeating marked this pull request as ready for review February 7, 2024 19:33
@alexkeating alexkeating force-pushed the feature/proposal-script branch 2 times, most recently from 4511fd1 to 346dea3 Compare February 8, 2024 16:03
@alexkeating alexkeating marked this pull request as draft February 8, 2024 22:11
@alexkeating alexkeating marked this pull request as ready for review February 8, 2024 22:43
Copy link
Collaborator

@wildmolasses wildmolasses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits; likely you'll want to ignore a bunch of them, but i left them here for completeness

script/ProposeFactorySetOwner.s.sol Outdated Show resolved Hide resolved
script/ProposeFactorySetOwner.s.sol Show resolved Hide resolved
script/ProposeFactorySetOwner.s.sol Outdated Show resolved Hide resolved
script/ProposeFactorySetOwner.s.sol Outdated Show resolved Hide resolved
script/ProposeFactorySetOwner.s.sol Show resolved Hide resolved
test/UniStaker.integration.t.sol Show resolved Hide resolved
test/UniStaker.integration.t.sol Outdated Show resolved Hide resolved
assertEq(factory.owner(), address(v3FactoryOwner));

assertEq(wbtcWethFeeProtocol, 10 + (10 << 4));
assertEq(daiWethFeeProtocol, 10 + (10 << 4));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these numbers? can you leave a comment?

also, can these numbers be fuzzed, or would we always expect them to be fixed/hardcoded in the script?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now they are hardcoded in the script. We could update the script to make these different from a testing perspective, but I don't know how much this gets us testing wise because we should already be fuzzing these values in the unit tests.

test/helpers/ProposalTest.sol Show resolved Hide resolved
test/helpers/ProposalTest.sol Show resolved Hide resolved
Copy link
Collaborator

@apbendi apbendi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @alexkeating overall it looks great, really glad to see the gov proposal testing infrastructure in place! Left some thoughts, feel free to push back or suggest alternatives to my suggestions.

script/ProposeFactorySetOwner.s.sol Outdated Show resolved Hide resolved
test/UniStaker.integration.t.sol Outdated Show resolved Hide resolved
test/helpers/ProposalTest.sol Outdated Show resolved Hide resolved
script/ProposeSetProtocolFeeOnPools.s.sol Outdated Show resolved Hide resolved
script/ProposeSetProtocolFeeOnPools.s.sol Outdated Show resolved Hide resolved
test/helpers/ProposalTest.sol Outdated Show resolved Hide resolved
test/helpers/ProposalTest.sol Outdated Show resolved Hide resolved
Copy link
Collaborator

@apbendi apbendi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some more comments @alexkeating. Thanks for bearing with multi-review cycles on the proposal scripts. Since they'll be used repeatedly over time, I want to make sure we get them right.

script/ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools.sol Outdated Show resolved Hide resolved
script/ProposeSetProtocolFeeOnPools.s.sol Outdated Show resolved Hide resolved
script/ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools.sol Outdated Show resolved Hide resolved
script/ProposeNewFeesOnWbtcWethDaiWethAndDaiUsdcPools.sol Outdated Show resolved Hide resolved
script/ProposeSetProtocolFeeOnPools.s.sol Outdated Show resolved Hide resolved
script/ProposeSetProtocolFeeOnPools.s.sol Outdated Show resolved Hide resolved
test/UniStaker.integration.t.sol Show resolved Hide resolved
test/helpers/ProposalTest.sol Outdated Show resolved Hide resolved
Copy link
Collaborator

@wildmolasses wildmolasses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, a few nits

);
}

/// @param _newV3FactoryOwner The new factory owner which should have be the recently deployed.
Copy link
Collaborator

@wildmolasses wildmolasses Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @param _newV3FactoryOwner The new factory owner which should have be the recently deployed.
/// @param _newV3FactoryOwner The new factory owner, i.e. the recently deployed V3FactoryOwner.

address _proposer =
vm.envOr("PROPOSER_ADDRESS", address(0x0459f41c5f09BF678D9C07331894dE31d8C22255));

/// @param _newV3FactoryOwner The new factory owner which should have be the recently deployed.
Copy link
Collaborator

@wildmolasses wildmolasses Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @param _newV3FactoryOwner The new factory owner which should have be the recently deployed.
/// @param _newV3FactoryOwner The new factory owner i.e. the recently deployed V3FactoryOwner.


/// @param _newV3FactoryOwner The new factory owner which should have be the recently deployed.
/// `V3FactoryOwner`
/// @dev After the UniStaker and V3FactoryOwner contracts are deployed a delegate should run this
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @dev After the UniStaker and V3FactoryOwner contracts are deployed a delegate should run this
/// @dev After the UniStaker and V3FactoryOwner contracts are deployed, a delegate should run this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^ also, it looks like there's a period on line 35 but the period should be on line 36

assertEq(oldDaiWethFeeProtocol, 0);
assertEq(oldDaiUsdcFeeProtocol, 0);

assertEq(newWbtcWethFeeProtocol, 10 + (10 << 4));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i appreciate now why we're hardcoding here, but can you leave a comment on why we're doing the addition?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add a comment

@alexkeating alexkeating merged commit 02d9ffa into main Feb 15, 2024
4 checks passed
Copy link

Coverage after merging feature/proposal-script into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   UniStaker.sol99.49%95.83%100%100%591
   V3FactoryOwner.sol100%100%100%100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal Script & Governance Spoofing in Integration Tests
3 participants