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

feat: Provide fee collector in constructor #41

Merged
merged 4 commits into from
Mar 13, 2023

Conversation

fzavalia
Copy link
Contributor

@fzavalia fzavalia commented Mar 13, 2023

Closes #26

Provide a fee collector via the constructor and store it in the contract.

This unblocks #27 were a function to update the fee collector by the owner will be added.

@@ -176,6 +178,7 @@ describe('DCL Names V2 with DCLControllerV2', function () {
dclControllerContract = await DCLControllerV2.new(
manaContract.address,
dclRegistrarContract.address,
feeCollector,
creationParams
Copy link
Contributor

@cyaiox cyaiox Mar 13, 2023

Choose a reason for hiding this comment

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

is this param still required in the constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is necessary as it will be the address that will receive the fees when a name is registered :)

Copy link
Contributor

Choose a reason for hiding this comment

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

my bad, I meant: creationParams

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is needed because it tells which signer is deploying the contract (the deployer determines the owner)

creationParams = {
      ...fromDeployer,

Copy link
Contributor

@cyaiox cyaiox left a comment

Choose a reason for hiding this comment

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

left a small comment, lgtm!

@@ -1959,18 +1963,31 @@ describe('DCL Names V2 with DCLControllerV2', function () {

const maxGasPrice = await dclControllerContract.maxGasPrice()
expect(maxGasPrice).to.eq.BN(MAX_GAS_PRICE)

const collector = await dclControllerContract.feeCollector()
expect(collector).to.eq.BN(feeCollector)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the BN needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not at all, nice catch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@fzavalia fzavalia merged commit 65f3ee2 into feat/stop-burning-mana Mar 13, 2023
@fzavalia fzavalia deleted the feat/contructor-fee-collector branch March 13, 2023 18:07
fzavalia added a commit that referenced this pull request Apr 18, 2023
* fix: Fix npm install issues by refactoring the repo (#34)

* fix: Npm install issues by refactoring the repo

* fix: Test script

* feat: Support coverage

* feat: Remove unused config

* fix: CI

* fix: CI

* chore: EOL

* chore: Update CI

* fix: Tests performance (#39)

* fix: Tests performance

---------

Co-authored-by: Nando <24811313+fzavalia@users.noreply.github.com>

* feat: Clone DCLController into DCLControllerV2 o contain future changes (#40)

* feat: Clone DCLController into DCLControllerV2 o contain future changes

* chore: EOL

* chore: EOL

* feat: Provide fee collector in constructor (#41)

* feat: Receive fee collector in constructor

* fix: FakeControllerV2

* chore: Test fee collector provided in constructor

* chore: Update test

* feat: Add function to update the fee collector (#42)

* feat: Receive fee collector in constructor

* fix: FakeControllerV2

* chore: Test fee collector provided in constructor

* feat: Function to set the fee collector

* chore: Test that constructor is using the internal set fee collector function

* chore: Test setFeeCollector function

* feat: Send fee to fee collector (#43)

* feat: Receive fee collector in constructor

* fix: FakeControllerV2

* chore: Test fee collector provided in constructor

* feat: Function to set the fee collector

* chore: Test that constructor is using the internal set fee collector function

* chore: Test setFeeCollector function

* feat: Transfer tokens to fee collector instead of burning

* chore: Fix tests

* chore: Test that the fee is transferred to the fee collector

* Update contracts/ens/DCLControllerV2.sol

Co-authored-by: Ignacio Mazzara <nachomazzara@gmail.com>
Signed-off-by: Fernando Zavalia <24811313+fzavalia@users.noreply.github.com>

* chore: Update test

* chore: Update test

* chore: Update test

---------

Signed-off-by: Fernando Zavalia <24811313+fzavalia@users.noreply.github.com>
Co-authored-by: Ignacio Mazzara <nachomazzara@gmail.com>

* feat: Validate collector is never address(0) (#45)

* feat: Validate fee collector is not address 0

* chore: Test that the fee collector is not 0

* chore: Add full DCLControllerV2 full contract (#46)

* feat: Add script to deploy new controller (#47)

* feat: Add script to deploy new controller

* chore: EOL

* chore: Add default network

* chore: Add default rpc url for deploy

* chore: Remove default network

* chore: Rename fixture

* feat: Remove mas gas price and validations (#49)

* feat: Provide owner on constructor (#51)

* feat: Provide owner on constructor

* chore: Test transfer ownership

* chore: Add natspec

* feat: Remove requireBalance function (#53)

* feat: Remove requireBalance function

* chore: Fix tests

* chore: Add comment about which ERC20 tokens should be used (#54)

* chore: Add comment about token

* chore: Remove

* chore: Add comment in contructor

* chore: Update comment

* chore: Update comment

* chore: Remove dot

* chore: Deploy mainnet (#55)

* chore: Update README

* chore: Update deploy script

---------

Signed-off-by: Fernando Zavalia <24811313+fzavalia@users.noreply.github.com>
Co-authored-by: Gabriel Díaz <gabrieldiaz31@gmail.com>
Co-authored-by: Ignacio Mazzara <nachomazzara@gmail.com>
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.

3 participants