Comments (6)
Hello! I am interested in this task. I have some experience in writing tests using typescript and chai for smart contracts.
@0xneves
from swaplace-contracts.
Well go for it, can't barely wait to see the PR @RafaDSan 👍
from swaplace-contracts.
Hey @RafaDSan , how is the task going? Do you need anything to help you with?
from swaplace-contracts.
Hey @0xneves, if this task isn't started, I'm interested to get
from swaplace-contracts.
@0xneves I've added some new tests to the TestMockContracts.test.ts
file but I am having some problems importing the ERC20 code.
Here is what I am doing:
- Copied the erc20 contract of blockful and pasted in the MockERC20.sol
- Changed the line
abstract contract ERC20 is IERC20, IERC20Permit, IERC20Errors
for and removed theabstract
- Added the following files to the
interfaces
directory:IERC20.SOL
,IERC20Errors.sol
,IERC20Permit.sol
- Run the command
npx hardhat test
and receive the following errorError: missing argument: in Contract constructor (count=0, expectedCount=2, code=MISSING_ARGUMENT, version=contracts/5.7.0)
which I am trying to figure it out rn.
from swaplace-contracts.
Hello @RafaDSan, I think you are misunderstanding the behavior of this task, let me summarize...
The ERC20 in blockful-contracts is abstract because it is an implementation, inside the 'contracts/test' folder you can find the token implementing the ERC.
In essence, the task is:
- Get the ERC20 related contracts from the blockful-contracts repo and place them in the MockERC20 of Swaplace.
- Copy the tests in the 'blockful-contracts/tests' folder and place them in the Swaplace tests folder.
The error you were getting was from changing the contract from abstract to non-abstract. Remember you should not change any aspects of the ERC20 contract, and only change the import of the MockERC20 from OpenZeppelin to the local contracts imported from 'blockful-contracts'.
from swaplace-contracts.
Related Issues (20)
- bug: refactor and other templates presenting issues
- refactor: Adding a test case for testing parseData() and packData()
- refactor: sloads and increments in assembly for gas optimization.
- refactor: drastically lowering cancelSwap gas consumption HOT 1
- refactor: Set the value of `config` as zero directly instead of packing `allowed` and `expiry` in the `acceptSwap()`.
- refactor: events must emit addresses involved in the operation for better dApp indexing HOT 3
- feat: create DefiLlama adapter to measure TVL HOT 2
- Smart Contract Issues HOT 5
- fix: incorrect event emission on acceptSwap HOT 2
- refactor: repo scripts section HOT 2
- chore: create revision branch and merge with local fork revision
- epic: native ether and ERC1155 swaps HOT 3
- test: create unitary tests for building native ether transfers in `TestSwapFactory.test.ts` HOT 2
- test: create unitary tests to implement native ether transfers in `TestSwaplace.test.ts` HOT 3
- test: create unitary tests for building ERC1155 assets in `TestSwapFactory.test.ts` HOT 2
- test: create unitary tests to implement ERC1155 assets for 1-1, 1-N and N-N HOT 2
- refactor: scripts for running the test suit with makefile need to be upgraded because of native ether feature HOT 2
- refactor: include ERC1155 mock to be deployed with the other types with the test suit scripts HOT 2
- refactor: include ERC1155 to be minted and approved with the other token types HOT 2
- refactor: include ERC1155 in the createSwap() and acceptSwap() scripts HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swaplace-contracts.