-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: Provide fee collector in constructor #41
Conversation
@@ -176,6 +178,7 @@ describe('DCL Names V2 with DCLControllerV2', function () { | |||
dclControllerContract = await DCLControllerV2.new( | |||
manaContract.address, | |||
dclRegistrarContract.address, | |||
feeCollector, | |||
creationParams |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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,
There was a problem hiding this 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the BN
needed?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
* 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>
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.