From cb433f26db54ffad614c59ab12d458a2a8fc6996 Mon Sep 17 00:00:00 2001 From: gretzke Date: Sat, 4 Nov 2023 01:59:15 +0100 Subject: [PATCH] small fixes --- .github/PULL_REQUEST_TEMPLATE.md | 16 +++++++++------- .../src/src/Counter.sol/contract.Counter.md | 10 +++++----- .../interface/ICounter.sol/interface.ICounter.md | 10 +++++----- .../IVersioned.sol/interface.IVersioned.md | 4 ++-- foundry.toml | 13 +++++++------ src/interface/ICounter.sol | 8 ++++---- src/interface/IVersioned.sol | 2 +- test/1.0.0/Counter.t.sol | 2 +- 8 files changed, 34 insertions(+), 31 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 49d17e9..3113159 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,7 +2,7 @@ ## Description -Please include a summary of the change and which issue is fixed. Also, include relevant motivation and context. List any dependencies that are required for this change. +Please include a summary of the change and which feature was implemented or which issue was fixed. Also, include relevant motivation and context. List any dependencies that are required for this change. Fixes # (issue) @@ -15,24 +15,26 @@ Please describe the tests that you ran to verify your changes. Provide instructi Before deployment - [ ] 100% test and branch coverage -- [ ] fuzz and invariant tests when applicable -- [ ] deployment or update scripts ready +- [ ] fuzz and invariant tests (when applicable) +- [ ] formal verification (when applicable) +- [ ] deployment or upgrade scripts ready - [ ] version management agreed upon and implemented -- [ ] documentation of work in Jira or Notion - [ ] internal team review - [ ] **Security Team review** After deployment -- [ ] Update [static](https://github.com/maticnetwork/static/tree/master/network) with new contract address and/or version -- [ ] create release if necessary +- [ ] transfer ownership after deployments (when applicable) +- [ ] complete upgrade (when applicable) +- [ ] generate deployment/upgrade log files +- [ ] update [static](https://github.com/maticnetwork/static/tree/master/network) with new contract address and/or version --- ### Considerations - I have followed the [contributing guidelines](../CONTRIBUTING.md). -- My code follows the style guidelines of this project and I have run `lint` to ensure the code style is valid +- My code follows the style guidelines of this project and I have run `forge fmt` and prettier to ensure the code style is valid - I have performed a self-review of my own code - I have commented my code, particularly in hard-to-understand areas - I have made corresponding changes to the documentation diff --git a/docs/autogen/src/src/Counter.sol/contract.Counter.md b/docs/autogen/src/src/Counter.sol/contract.Counter.md index 4c3583e..27b0485 100644 --- a/docs/autogen/src/src/Counter.sol/contract.Counter.md +++ b/docs/autogen/src/src/Counter.sol/contract.Counter.md @@ -1,5 +1,5 @@ # Counter -[Git Source](https://github.com/0xPolygon/foundry-template/blob/1982945ef9a5f6e6ec018759f8fcd1f51129ed46/src/Counter.sol) +[Git Source](https://github.com/0xPolygon/foundry-template/blob/55b07186cd4779cbe55cc2f262f992aeabaf34ad/src/Counter.sol) **Inherits:** [ICounter](/docs/autogen/src/src/interface/ICounter.sol/interface.ICounter.md), Initializable @@ -23,7 +23,7 @@ function initialize(uint256 initialNumber) public initializer; ### setNumber -Sets the number. +Sets the number ```solidity @@ -33,12 +33,12 @@ function setNumber(uint256 newNumber) public; |Name|Type|Description| |----|----|-----------| -|`newNumber`|`uint256`|The new number.| +|`newNumber`|`uint256`|The new number| ### increment -Increments the number by 1. +Increments the number by 1 ```solidity @@ -55,6 +55,6 @@ function version() external pure returns (string memory); |Name|Type|Description| |----|----|-----------| -|``|`string`|The version of the contract.| +|``|`string`|The version of the contract| diff --git a/docs/autogen/src/src/interface/ICounter.sol/interface.ICounter.md b/docs/autogen/src/src/interface/ICounter.sol/interface.ICounter.md index 83f228a..d207307 100644 --- a/docs/autogen/src/src/interface/ICounter.sol/interface.ICounter.md +++ b/docs/autogen/src/src/interface/ICounter.sol/interface.ICounter.md @@ -1,5 +1,5 @@ # ICounter -[Git Source](https://github.com/0xPolygon/foundry-template/blob/1982945ef9a5f6e6ec018759f8fcd1f51129ed46/src/interface/ICounter.sol) +[Git Source](https://github.com/0xPolygon/foundry-template/blob/55b07186cd4779cbe55cc2f262f992aeabaf34ad/src/interface/ICounter.sol) **Inherits:** [IVersioned](/docs/autogen/src/src/interface/IVersioned.sol/interface.IVersioned.md) @@ -16,12 +16,12 @@ function number() external view returns (uint256); |Name|Type|Description| |----|----|-----------| -|``|`uint256`|The current number.| +|``|`uint256`|The current number| ### setNumber -Sets the number. +Sets the number ```solidity @@ -31,12 +31,12 @@ function setNumber(uint256 newNumber) external; |Name|Type|Description| |----|----|-----------| -|`newNumber`|`uint256`|The new number.| +|`newNumber`|`uint256`|The new number| ### increment -Increments the number by 1. +Increments the number by 1 ```solidity diff --git a/docs/autogen/src/src/interface/IVersioned.sol/interface.IVersioned.md b/docs/autogen/src/src/interface/IVersioned.sol/interface.IVersioned.md index 7ee30ec..c319a0e 100644 --- a/docs/autogen/src/src/interface/IVersioned.sol/interface.IVersioned.md +++ b/docs/autogen/src/src/interface/IVersioned.sol/interface.IVersioned.md @@ -1,5 +1,5 @@ # IVersioned -[Git Source](https://github.com/0xPolygon/foundry-template/blob/1982945ef9a5f6e6ec018759f8fcd1f51129ed46/src/interface/IVersioned.sol) +[Git Source](https://github.com/0xPolygon/foundry-template/blob/55b07186cd4779cbe55cc2f262f992aeabaf34ad/src/interface/IVersioned.sol) ## Functions @@ -13,6 +13,6 @@ function version() external pure returns (string memory); |Name|Type|Description| |----|----|-----------| -|``|`string`|The version of the contract.| +|``|`string`|The version of the contract| diff --git a/foundry.toml b/foundry.toml index 125c1af..e0878bd 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,11 +1,11 @@ [profile.default] -src = 'src' -out = 'out' -libs = ['lib'] +src = "src" +out = "out" +libs = ["lib"] optimizer = true optimize_runs = 999999 via_ir = true -solc = '0.8.22' +solc = "0.8.22" verbosity = 2 ffi = true fs_permissions = [ @@ -14,8 +14,9 @@ fs_permissions = [ ] remappings = [ - "@openzeppelin/contracts=lib/openzeppelin-contracts/contracts", - "@openzeppelin/contracts-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts" + "forge-std=lib/forge-std/src", + "@openzeppelin/contracts=lib/openzeppelin-contracts/contracts", + "@openzeppelin/contracts-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts" ] [profile.intense.fuzz] diff --git a/src/interface/ICounter.sol b/src/interface/ICounter.sol index 4eb5c3b..d499905 100644 --- a/src/interface/ICounter.sol +++ b/src/interface/ICounter.sol @@ -4,13 +4,13 @@ pragma solidity 0.8.22; import {IVersioned} from "./IVersioned.sol"; interface ICounter is IVersioned { - /// @return The current number. + /// @return The current number function number() external view returns (uint256); - /// @notice Sets the number. - /// @param newNumber The new number. + /// @notice Sets the number + /// @param newNumber The new number function setNumber(uint256 newNumber) external; - /// @notice Increments the number by 1. + /// @notice Increments the number by 1 function increment() external; } diff --git a/src/interface/IVersioned.sol b/src/interface/IVersioned.sol index badd969..dc6caae 100644 --- a/src/interface/IVersioned.sol +++ b/src/interface/IVersioned.sol @@ -2,6 +2,6 @@ pragma solidity 0.8.22; interface IVersioned { - /// @return The version of the contract. + /// @return The version of the contract function version() external pure returns (string memory); } diff --git a/test/1.0.0/Counter.t.sol b/test/1.0.0/Counter.t.sol index a58d536..2c9b2e1 100644 --- a/test/1.0.0/Counter.t.sol +++ b/test/1.0.0/Counter.t.sol @@ -6,7 +6,7 @@ import "test/util/TestHelpers.sol"; import "script/1.0.0/Deploy.s.sol"; -abstract contract BeforeScript is Test, TestHelpers, CounterDeployer { +abstract contract BeforeScript is TestHelpers, CounterDeployer { Counter internal counter; function setUp() public {