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

PP-566: migrate script deploy collector #95

Conversation

AndresQuijano
Copy link
Contributor

What

  • Migrates the script to deploy to collector to use Hardhat and Ethers.js

Why

  • Modernization of the project

Refs

-PP-566

@antomor antomor force-pushed the PP566/migrate_script_deploy_collector branch from d5a4d5b to f2d637d Compare November 22, 2022 08:53
{
function penalize(
address relayWorker,
address payable beneficiary

Check notice

Code scanning / Slither

Missing zero address validation

RelayHub.penalize(address,address).beneficiary (contracts/RelayHub.sol#248) lacks a zero-check on : - beneficiary.transfer(reward) (contracts/RelayHub.sol#273)
returns (bool success, bytes memory ret)
{
function directExecute(
address to,

Check notice

Code scanning / Slither

Missing zero address validation

CustomSmartWallet.directExecute(address,bytes).to (contracts/smartwallet/CustomSmartWallet.sol#123) lacks a zero-check on : - (success,ret) = to.call{value: msg.value}(data) (contracts/smartwallet/CustomSmartWallet.sol#141)
returns (bool success, bytes memory ret)
{
function directExecute(
address to,

Check notice

Code scanning / Slither

Missing zero address validation

SmartWallet.directExecute(address,bytes).to (contracts/smartwallet/SmartWallet.sol#115) lacks a zero-check on : - (success,ret) = to.call{value: msg.value}(data) (contracts/smartwallet/SmartWallet.sol#124)
noBalanceToShare
{
function updateRemainderAddress(
address remainderAddress

Check notice

Code scanning / Slither

Missing zero address validation

Collector.updateRemainderAddress(address).remainderAddress (contracts/Collector.sol#69) lacks a zero-check on : - _remainderAddress = remainderAddress (contracts/Collector.sol#78)
hardhat.config.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
hardhat.config.ts Outdated Show resolved Hide resolved
@antomor antomor marked this pull request as ready for review November 22, 2022 22:14
@antomor
Copy link
Collaborator

antomor commented Nov 22, 2022

All the changes to the solidity contracts are related to formatting rules. No logic has been changed there.

hardhat.config.ts Outdated Show resolved Hide resolved
Readme.md Outdated Show resolved Hide resolved
hardhat.config.ts Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Copy link
Contributor

@ironFe93 ironFe93 left a comment

Choose a reason for hiding this comment

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

--network option is missing in the package.json

edit: network CAN be specified without previously including the --network flag in the package json.

Remove some scripts from the package.json
Use console.table to print the collector output
Rename the input config file parameter
@antomor
Copy link
Collaborator

antomor commented Nov 23, 2022

@franciscotobar: I applied the renaming of the input param.
@ironFe93: I decided to remove some tasks from the package.json because there was no point to have them there.
@jurajpiar I changed the way we log the output information, but we still use the old way to build the factory. Some tests were failing and that change may require some additional investigation.
Could you please review the changes? 🙏🏼

Copy link
Contributor

@ironFe93 ironFe93 left a comment

Choose a reason for hiding this comment

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

agree on removing stuff from package json

@@ -65,9 +63,9 @@
"ci:test": "npm run test",
"clean": "rm -rf typechain-types cache bin dist artifacts contracts-exposed",
"postclean": "hardhat clean",
"collector:deploy": "hardhat deploy-collector",
"compile": "npm run clean && hardhat compile --force",
"deploy": "hardhat deploy --network",
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with not cluttering the package json with scripts. Shouldn't the 'deploy' script also be removed from here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wasn't unsure about it. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

It falls under the same category as all other tasks, so yes, we could remove it.

Copy link
Member

@jurajpiar jurajpiar left a comment

Choose a reason for hiding this comment

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

LG

@antomor antomor merged commit e0ff1a6 into feature/PP-278/PP-329/upgrade_contracts Nov 24, 2022
@antomor antomor deleted the PP566/migrate_script_deploy_collector branch November 24, 2022 13:10
antomor added a commit that referenced this pull request Nov 30, 2022
* feat: dummy commit, create empty deployCollector.ts file

* refactor: add script and task to deploy a Collector using Hardhat and Ethers.js

* style: apply format rules

* test: add the tests, remove the positional arguments and simplify the output file

* fix: apply PR suggestions

Remove some scripts from the package.json
Use console.table to print the collector output
Rename the input config file parameter

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>
antomor pushed a commit that referenced this pull request Jan 26, 2023
feat(upgrade): re-create project with hardhat & ethers
removing truffle and web3

chore: re-adds contracts

chore: adds dev rules

chore(contracts): fixes solidity lint errors

chore(test): re-adds tests

chore(upgrade): adds deployment tools

chore(upgrade): add smock for contract mocking

chore(upgrade): removes sol tests

chore(upgrade): fixe pre-commit and update readme

chore(upgrade): add more eslint rules

chore(deps): move typechain to deps

chore(upgrade): unignore dist from npm i

chore(ethers): return util token for manual testing 👿

PP-565: migrate the removeTokens script to use Hardhat and Ethers.js (#92)

* refactor: migrate the removeTokens script to use Hardhat and Ethers.js

* fix: fix the task in hardhat.config, update Readme and apply format

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-566: migrate script deploy collector (#95)

* feat: dummy commit, create empty deployCollector.ts file

* refactor: add script and task to deploy a Collector using Hardhat and Ethers.js

* style: apply format rules

* test: add the tests, remove the positional arguments and simplify the output file

* fix: apply PR suggestions

Remove some scripts from the package.json
Use console.table to print the collector output
Rename the input config file parameter

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-569: migrate change partners (#97)

* chore: change package.json version

* feat: migrate the change-partners script to use ether.js

* fix: change the parseJsonFile function to return undefined

* fix: apply PR suggestions

* Revert "style: include automatically formatted solidity files"

This reverts commit 76ee863.

* fix: remove the script from package.json and update Readme.md

* style: apply formatting rules

PP-567 Migrate Withdraw Task (#93)

* feat: new hardhat task

* feat: create withdraw task

* chore: update readme

* feat: complete withdrawal task and tests

* chore: linted

* fix: no from parameter on withdraw

* chore: change readme, description of task

* feat: reorganize tasks and tests

* fix: restore .prepare script

* fix: typo on script

* fix: restore file permissions

* fix: prettier issues, no waffle json file

* fix: no prepare task

* chore: remove unneeded rules

* fix: change Readme.md to fix the command instruction

* fix: restore the collector:deploy sample config file

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-355/update-rif-relay-server (#96)

* refactor(index): expose typing for relay-server

* refactor: prettier

fix: fix the collector and add the missing tests

Fix the collector updateRemainderAddress
Include the missing test for the stakeForAddress method

fix: add config to use custom signers to run scripts (#106)

feat: expiration mechanism (#105)

* feat: expiration mechanism

* fix: FWD to SW

* feat: validate time on deploy

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>

PP-602/RelayClient: _validateSmartWallet (#109)

* refactor(SmartWallet): expose getOwner
* refactor(index): expose PromiseOrValue
* chore: github workflow

PP-358: include the contracts in dist (#112)

* fix: remove contracts from npmignore

* chore: rename .prettierrc to prettier.json5 to be consistent among all the repos

PP-357: Add a task to mint utility tokens (#113)

* feat: add a task to mint utility tokens

* fix: apply linting and format to tasks

* refactor: expose RelayHubInterface

* docs: readme

Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>
antomor pushed a commit that referenced this pull request Jan 26, 2023
feat(upgrade): re-create project with hardhat & ethers
removing truffle and web3

chore: re-adds contracts

chore: adds dev rules

chore(contracts): fixes solidity lint errors

chore(test): re-adds tests

chore(upgrade): adds deployment tools

chore(upgrade): add smock for contract mocking

chore(upgrade): removes sol tests

chore(upgrade): fixe pre-commit and update readme

chore(upgrade): add more eslint rules

chore(deps): move typechain to deps

chore(upgrade): unignore dist from npm i

chore(ethers): return util token for manual testing 👿

PP-565: migrate the removeTokens script to use Hardhat and Ethers.js (#92)

* refactor: migrate the removeTokens script to use Hardhat and Ethers.js

* fix: fix the task in hardhat.config, update Readme and apply format

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-566: migrate script deploy collector (#95)

* feat: dummy commit, create empty deployCollector.ts file

* refactor: add script and task to deploy a Collector using Hardhat and Ethers.js

* style: apply format rules

* test: add the tests, remove the positional arguments and simplify the output file

* fix: apply PR suggestions

Remove some scripts from the package.json
Use console.table to print the collector output
Rename the input config file parameter

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-569: migrate change partners (#97)

* chore: change package.json version

* feat: migrate the change-partners script to use ether.js

* fix: change the parseJsonFile function to return undefined

* fix: apply PR suggestions

* Revert "style: include automatically formatted solidity files"

This reverts commit 76ee863.

* fix: remove the script from package.json and update Readme.md

* style: apply formatting rules

PP-567 Migrate Withdraw Task (#93)

* feat: new hardhat task

* feat: create withdraw task

* chore: update readme

* feat: complete withdrawal task and tests

* chore: linted

* fix: no from parameter on withdraw

* chore: change readme, description of task

* feat: reorganize tasks and tests

* fix: restore .prepare script

* fix: typo on script

* fix: restore file permissions

* fix: prettier issues, no waffle json file

* fix: no prepare task

* chore: remove unneeded rules

* fix: change Readme.md to fix the command instruction

* fix: restore the collector:deploy sample config file

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-355/update-rif-relay-server (#96)

* refactor(index): expose typing for relay-server

* refactor: prettier

fix: fix the collector and add the missing tests

Fix the collector updateRemainderAddress
Include the missing test for the stakeForAddress method

fix: add config to use custom signers to run scripts (#106)

feat: expiration mechanism (#105)

* feat: expiration mechanism

* fix: FWD to SW

* feat: validate time on deploy

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>

PP-602/RelayClient: _validateSmartWallet (#109)

* refactor(SmartWallet): expose getOwner
* refactor(index): expose PromiseOrValue
* chore: github workflow

PP-358: include the contracts in dist (#112)

* fix: remove contracts from npmignore

* chore: rename .prettierrc to prettier.json5 to be consistent among all the repos

PP-357: Add a task to mint utility tokens (#113)

* feat: add a task to mint utility tokens

* fix: apply linting and format to tasks

* refactor: expose RelayHubInterface

* docs: readme

Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>
antomor added a commit that referenced this pull request Jan 27, 2023
* chore(ethers): change to ethers and updgrade dependencies

feat(upgrade): re-create project with hardhat & ethers
removing truffle and web3

chore: re-adds contracts

chore: adds dev rules

chore(contracts): fixes solidity lint errors

chore(test): re-adds tests

chore(upgrade): adds deployment tools

chore(upgrade): add smock for contract mocking

chore(upgrade): removes sol tests

chore(upgrade): fixe pre-commit and update readme

chore(upgrade): add more eslint rules

chore(deps): move typechain to deps

chore(upgrade): unignore dist from npm i

chore(ethers): return util token for manual testing 👿

PP-565: migrate the removeTokens script to use Hardhat and Ethers.js (#92)

* refactor: migrate the removeTokens script to use Hardhat and Ethers.js

* fix: fix the task in hardhat.config, update Readme and apply format

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-566: migrate script deploy collector (#95)

* feat: dummy commit, create empty deployCollector.ts file

* refactor: add script and task to deploy a Collector using Hardhat and Ethers.js

* style: apply format rules

* test: add the tests, remove the positional arguments and simplify the output file

* fix: apply PR suggestions

Remove some scripts from the package.json
Use console.table to print the collector output
Rename the input config file parameter

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-569: migrate change partners (#97)

* chore: change package.json version

* feat: migrate the change-partners script to use ether.js

* fix: change the parseJsonFile function to return undefined

* fix: apply PR suggestions

* Revert "style: include automatically formatted solidity files"

This reverts commit 76ee863.

* fix: remove the script from package.json and update Readme.md

* style: apply formatting rules

PP-567 Migrate Withdraw Task (#93)

* feat: new hardhat task

* feat: create withdraw task

* chore: update readme

* feat: complete withdrawal task and tests

* chore: linted

* fix: no from parameter on withdraw

* chore: change readme, description of task

* feat: reorganize tasks and tests

* fix: restore .prepare script

* fix: typo on script

* fix: restore file permissions

* fix: prettier issues, no waffle json file

* fix: no prepare task

* chore: remove unneeded rules

* fix: change Readme.md to fix the command instruction

* fix: restore the collector:deploy sample config file

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-355/update-rif-relay-server (#96)

* refactor(index): expose typing for relay-server

* refactor: prettier

fix: fix the collector and add the missing tests

Fix the collector updateRemainderAddress
Include the missing test for the stakeForAddress method

fix: add config to use custom signers to run scripts (#106)

feat: expiration mechanism (#105)

* feat: expiration mechanism

* fix: FWD to SW

* feat: validate time on deploy

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>

PP-602/RelayClient: _validateSmartWallet (#109)

* refactor(SmartWallet): expose getOwner
* refactor(index): expose PromiseOrValue
* chore: github workflow

PP-358: include the contracts in dist (#112)

* fix: remove contracts from npmignore

* chore: rename .prettierrc to prettier.json5 to be consistent among all the repos

PP-357: Add a task to mint utility tokens (#113)

* feat: add a task to mint utility tokens

* fix: apply linting and format to tasks

* refactor: expose RelayHubInterface

* docs: readme

Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>

* fix: apply format and lint rules

---------

Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>
antomor added a commit that referenced this pull request Feb 3, 2023
* chore(ethers): change to ethers and updgrade dependencies

feat(upgrade): re-create project with hardhat & ethers
removing truffle and web3

chore: re-adds contracts

chore: adds dev rules

chore(contracts): fixes solidity lint errors

chore(test): re-adds tests

chore(upgrade): adds deployment tools

chore(upgrade): add smock for contract mocking

chore(upgrade): removes sol tests

chore(upgrade): fixe pre-commit and update readme

chore(upgrade): add more eslint rules

chore(deps): move typechain to deps

chore(upgrade): unignore dist from npm i

chore(ethers): return util token for manual testing 👿

PP-565: migrate the removeTokens script to use Hardhat and Ethers.js (#92)

* refactor: migrate the removeTokens script to use Hardhat and Ethers.js

* fix: fix the task in hardhat.config, update Readme and apply format

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-566: migrate script deploy collector (#95)

* feat: dummy commit, create empty deployCollector.ts file

* refactor: add script and task to deploy a Collector using Hardhat and Ethers.js

* style: apply format rules

* test: add the tests, remove the positional arguments and simplify the output file

* fix: apply PR suggestions

Remove some scripts from the package.json
Use console.table to print the collector output
Rename the input config file parameter

Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-569: migrate change partners (#97)

* chore: change package.json version

* feat: migrate the change-partners script to use ether.js

* fix: change the parseJsonFile function to return undefined

* fix: apply PR suggestions

* Revert "style: include automatically formatted solidity files"

This reverts commit 76ee863.

* fix: remove the script from package.json and update Readme.md

* style: apply formatting rules

PP-567 Migrate Withdraw Task (#93)

* feat: new hardhat task

* feat: create withdraw task

* chore: update readme

* feat: complete withdrawal task and tests

* chore: linted

* fix: no from parameter on withdraw

* chore: change readme, description of task

* feat: reorganize tasks and tests

* fix: restore .prepare script

* fix: typo on script

* fix: restore file permissions

* fix: prettier issues, no waffle json file

* fix: no prepare task

* chore: remove unneeded rules

* fix: change Readme.md to fix the command instruction

* fix: restore the collector:deploy sample config file

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>

PP-355/update-rif-relay-server (#96)

* refactor(index): expose typing for relay-server

* refactor: prettier

fix: fix the collector and add the missing tests

Fix the collector updateRemainderAddress
Include the missing test for the stakeForAddress method

fix: add config to use custom signers to run scripts (#106)

feat: expiration mechanism (#105)

* feat: expiration mechanism

* fix: FWD to SW

* feat: validate time on deploy

Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>

PP-602/RelayClient: _validateSmartWallet (#109)

* refactor(SmartWallet): expose getOwner
* refactor(index): expose PromiseOrValue
* chore: github workflow

PP-358: include the contracts in dist (#112)

* fix: remove contracts from npmignore

* chore: rename .prettierrc to prettier.json5 to be consistent among all the repos

PP-357: Add a task to mint utility tokens (#113)

* feat: add a task to mint utility tokens

* fix: apply linting and format to tasks

* refactor: expose RelayHubInterface

* docs: readme

Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>

* fix: apply format and lint rules

---------

Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>
antomor added a commit that referenced this pull request Feb 6, 2023
feat(upgrade): re-create project with hardhat & ethers removing truffle and web3

* PP-565: migrate the removeTokens script to use Hardhat and Ethers.js (#92)
* fix: fix the task in hardhat.config, update Readme and apply format
* PP-566: migrate script deploy collector (#95)
* test: add the tests, remove the positional arguments and simplify the output file
* Rename the input config file parameter
* PP-569: migrate change partners (#97)
* chore: change package.json version
* feat: migrate the change-partners script to use ether.js
* fix: change the parseJsonFile function to return undefined
* fix: apply PR suggestions
* fix: remove the script from package.json and update Readme.md
* PP-567 Migrate Withdraw Task (#93)
* feat: new hardhat task
* feat: create withdraw task
* feat: complete withdrawal task and tests
* fix: no from parameter on withdraw
* feat: reorganize tasks and tests
* fix: restore .prepare script
* fix: no prepare task
* chore: remove unneeded rules
* fix: change Readme.md to fix the command instruction
* fix: restore the collector:deploy sample config file
* PP-355/update-rif-relay-server (#96)
* refactor(index): expose typing for relay-server
* fix: fix the collector and add the missing tests
* Fix the collector updateRemainderAddress
* Include the missing test for the stakeForAddress method
* fix: add config to use custom signers to run scripts (#106)
* feat: expiration mechanism (#105)
* feat: expiration mechanism
* feat: validate time on deploy
* PP-602/RelayClient: _validateSmartWallet (#109)
* refactor(SmartWallet): expose getOwner
* refactor(index): expose PromiseOrValue
* chore: github workflow
* PP-358: include the contracts in dist (#112)
* fix: remove contracts from npmignore
* PP-357: Add a task to mint utility tokens (#113)
* feat: add a task to mint utility tokens
* fix: apply linting and format to tasks
* refactor: expose RelayHubInterface
* docs: readme

* 2.0.0-beta.0
* fix: replace master with main on codeql workflow (#116)
* fix: comment the NativeHolderSmartWallet unit tests and fix IForwarder

---------
Co-authored-by: Antonio Morrone <antonio@iovlabs.org>
Co-authored-by: Juraj <juraj.piar@icloud.com>
Co-authored-by: Francisco Tobar <francisco.tobar@iovlabs.org>
Co-authored-by: Christos Otarola <christos@Christoss-MacBook-Pro.local>
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.

None yet

5 participants