-
Notifications
You must be signed in to change notification settings - Fork 0
Open
0 / 10 of 1 issue completedLabels
good first issueGood for newcomersGood for newcomers
Description
Reviewer's Guide
This pull request adds two ERC20 token implementations (a reflective fee-based token and an OpenZeppelin upgradeable token), accompanied by unit tests, TypeScript deployment utilities, and commits all generated contract artifacts, metadata, and configuration files.
Sequence diagram for contract deployment using web3-lib.ts
sequenceDiagram
participant D as "Developer"
participant W as "web3-lib.ts"
participant Remix as "remix IDE"
participant Eth as "Ethereum Node"
D->>W: Call deploy(contractName, args, from, gas)
W->>Remix: Get contract artifact JSON
Remix-->>W: Return ABI and bytecode
W->>Eth: Send contract deployment transaction
Eth-->>W: Return deployed contract address
W-->>D: Return contract instance
Sequence diagram for contract deployment using ethers-lib.ts
sequenceDiagram
participant D as "Developer"
participant E as "ethers-lib.ts"
participant Remix as "remix IDE"
participant Eth as "Ethereum Node"
D->>E: Call deploy(contractName, args, accountIndex)
E->>Remix: Get contract artifact JSON
Remix-->>E: Return ABI and bytecode
E->>Eth: Send contract deployment transaction
Eth-->>E: Return deployed contract address
E-->>D: Return contract instance
Class diagram for Token.sol reflective ERC20 implementation
classDiagram
class Token {
+string _name
+string _symbol
+uint8 _decimals
+uint256 _tTotal
+uint256 _rTotal
+uint256 _tFeeTotal
+uint8 _taxFee
+uint8 _liquidityFee
+uint8 _burnFee
+uint8 _walletFee
+uint8 _buybackFee
+address feeWallet
+address pcsV2Pair
+IUniswapV2Router02 pcsV2Router
+constructor(address tokenOwner, string tokenName, string tokenSymbol, uint8 decimal, uint256 amountOfTokenWei, uint8 setMxTxPer, uint8 setMxWalletPer, address payable _feeWallet)
+transfer(address recipient, uint256 amount)
+transferFrom(address sender, address recipient, uint256 amount)
+approve(address spender, uint256 amount)
+setAllFeePercent(uint8 taxFee, uint8 liquidityFee, uint8 burnFee, uint8 walletFee, uint8 buybackFee)
+setMaxTxPercent(uint256 maxTxPercent)
+setMaxWalletPercent(uint256 maxWalletPercent)
+setSwapAndLiquifyEnabled(bool _enabled)
+setFeeWallet(address payable newFeeWallet)
+excludeFromFee(address account)
+includeInFee(address account)
+excludeFromReward(address account)
+includeInReward(address account)
+recoverBEP20(address tokenAddress, uint256 tokenAmount)
+swapAndLiquify(uint256 contractTokenBalance)
+buyBackTokens(uint256 amount)
+swapTokensForBNB(uint256 tokenAmount)
+swapBNBForTokens(uint256 amount)
+addLiquidity(uint256 tokenAmount, uint256 ethAmount)
}
Token --|> IERC20
Token --|> Ownable
Token --|> Context
Token o-- IUniswapV2Router02
Token o-- IUniswapV2Factory
Token o-- SafeMath
Token o-- SafeERC20
Token o-- Address
Class diagram for MyToken.sol upgradeable ERC20 implementation
classDiagram
class MyToken {
+constructor()
+initialize(address initialOwner)
+pause()
+unpause()
+mint(address to, uint256 amount)
+_authorizeUpgrade(address newImplementation)
+_update(address from, address to, uint256 value)
}
MyToken --|> Initializable
MyToken --|> ERC20Upgradeable
MyToken --|> ERC20BurnableUpgradeable
MyToken --|> ERC20PausableUpgradeable
MyToken --|> OwnableUpgradeable
MyToken --|> ERC20PermitUpgradeable
MyToken --|> UUPSUpgradeable
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Implement reflective ERC20 token with fees, liquidity and Uniswap integration |
|
contracts/Token.sol |
| Implement OpenZeppelin upgradeable ERC20 token with advanced features |
|
contracts/MyToken.sol |
| Add TypeScript deployment utilities and scripts |
|
scripts/web3-lib.tsscripts/ethers-lib.tsscripts/deploy_with_web3.tsscripts/deploy_with_ethers.ts |
| Add basic Solidity unit tests with custom transaction context |
|
tests/remix_tests_test.sol |
| Commit generated contract artifacts, metadata and build-info |
|
contracts/artifactscontracts/artifacts/build-infotests/artifacts |
| Add configuration and supporting files |
|
contracts/scenario.json |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summaryon the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment
@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request
summary, the reviewer's guide, and others. - Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Originally posted by @sourcery-ai[bot] in #83 (comment)
Reactions are currently unavailable
Sub-issues
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers
Projects
Status
Backlog
Status
Todo