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

chore(release): EtomicSwap 1.1.0 #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .env.empty

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ typings/
.env

.idea
merge
merge

artifacts
cache
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ services:
- docker

before_install:
- cp .env.empty .env
- docker-compose build
- docker-compose up -d

script:
- docker-compose exec workspace yarn
- docker-compose exec workspace truffle test
- docker-compose exec workspace npx hardhat test
- docker-compose down
41 changes: 31 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Etomic Swap Smart Contracts for BarterDex platform.
# Etomic Swap Smart Contracts for Komodo SDK.
[![Build Status](https://travis-ci.org/artemii235/etomic-swap.svg?branch=master)](https://travis-ci.org/artemii235/etomic-swap)
Etomic swap Smart Contract is implemented to support ETH and ERC20 atomic swaps on BarterDex platform.
Etomic swap Smart Contract is implemented to support ETH and ERC20 atomic swaps on Komodo SDK.
Please note that this project is not production ready yet!

## Swap workflow
Expand All @@ -21,19 +21,40 @@ Despite example shows swap of ETH/ERC20 this approach will work also for ETH/ERC

## How to setup dev environment?

**Note:**
This setup supports both Docker Compose V1 (using `docker-compose` commands) and Docker Compose V2 (using `docker compose` commands).
Docker Compose V2 is preferable, as [from July 2023 Compose V1 stopped receiving updates](https://docs.docker.com/compose/).

1. Install docker.
1. Run `docker-compose build`.
1. `cp .env.empty .env`.
1. Start containers `docker-compose up -d`.
1. Install project dependencies: `docker-compose exec workspace yarn`.
1. To run tests: `docker-compose exec workspace truffle test`.
1. Run `docker compose build`.
1. Start containers `docker compose up -d`.
1. Install project dependencies: `docker compose exec workspace yarn`.
1. To run tests: `docker compose exec workspace npx hardhat test`.
1. To clean artifacts and cache: `docker compose exec workspace npx hardhat clean`.
1. Stop containers `docker compose down`.

## Related links

1. Komodo platform - https://www.komodoplatform.com

## Useful links for smart contracts development

1. Truffle suite - https://github.com/trufflesuite/truffle
1. Ganache-cli (EthereumJS Testrpc) - https://github.com/trufflesuite/ganache-cli
1. Zeppelin Solidity - https://github.com/OpenZeppelin/zeppelin-solidity
1. **Hardhat:** An Ethereum development environment. It facilitates building, testing, and deploying smart contracts. - https://hardhat.org
1. **Ethers.js:** A complete Ethereum library and wallet implementation in JavaScript. - https://github.com/ethers-io/ethers.js
1. **OpenZeppelin Contracts:** A library for secure smart contract development. It provides reusable contracts which are secure and tested. - https://github.com/OpenZeppelin/openzeppelin-contracts

## Contribution Guide

- Run Docker tests to ensure that the project is set up successfully.
- Write tests for new contracts and functionalities.
- Run tests to confirm that new implementations work correctly.
- Format Solidity code before opening a pull request (PR). For formatting, you can use Remix Online IDE - https://remix.ethereum.org/

## Where Can I Write Solidity Code?

### Notes for Those Without an IDE:
Using Remix Online IDE is sufficient. There's no need to install anything locally.

### Notes for JetBrains or Visual Studio Code (VSCode) Users:
- These IDEs offer Solidity and HardHat plugins, which can simplify your workflow. However, Remix Online IDE is also a viable option.
- To index JavaScript code, execute the Docker commands as mentioned. Necessary dependencies will be downloaded, enabling the IDE to index the rest of the code.
12 changes: 12 additions & 0 deletions contracts/Erc1155Token.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

contract Erc1155Token is ERC1155 {
constructor(string memory tokenUri) ERC1155(tokenUri) {
uint256 tokenId = 1;
uint256 amount = 3;
_mint(msg.sender, tokenId, amount, "");
}
}
13 changes: 13 additions & 0 deletions contracts/Erc721Token.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract Erc721Token is ERC721 {
constructor(string memory tokenName, string memory tokenSymbol)
ERC721(tokenName, tokenSymbol)
{
uint256 tokenId = 1;
_mint(msg.sender, tokenId);
}
}
Loading