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

Initilization #6

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
884535b
feat: wip
harpy-wings Jul 31, 2023
bfb9cfc
feat: implement ITRC20
harpy-wings Jul 31, 2023
350461f
wip
harpy-wings Aug 2, 2023
fb48431
wip
harpy-wings Aug 3, 2023
ccde292
update git config
harpy-wings Aug 4, 2023
60a5a7c
Contracts
harpy-wings Aug 8, 2023
be72cbe
Merge branch 'initilization' of github.com:echotrade-app/contracts in…
harpy-wings Aug 8, 2023
19855a7
package.json added
tiny-rick-sanchez Aug 8, 2023
f82d13e
Feat: update version
harpy-wings Aug 8, 2023
08b3cf7
Merge branch 'initilization' of github.com:echotrade-app/contracts in…
harpy-wings Aug 8, 2023
549c1f2
wip
harpy-wings Aug 8, 2023
21cc40d
wip
harpy-wings Aug 8, 2023
37de540
wip: basket
harpy-wings Aug 8, 2023
5471162
wip
harpy-wings Aug 9, 2023
d485a53
WIP
harpy-wings Aug 13, 2023
2cfa60f
wip
harpy-wings Aug 13, 2023
37e01b8
wip
harpy-wings Aug 14, 2023
61df3a4
wip
harpy-wings Aug 14, 2023
28c26ae
wip
harpy-wings Aug 14, 2023
410a2fd
wip
harpy-wings Aug 19, 2023
02d9739
wip
harpy-wings Aug 20, 2023
c8ad4f1
wip
harpy-wings Aug 21, 2023
7a67df6
wip
harpy-wings Aug 21, 2023
14bed6b
wip
harpy-wings Aug 22, 2023
82ec7a1
wip
harpy-wings Aug 22, 2023
1bc90d1
wip
harpy-wings Aug 23, 2023
870cddc
feat: close the basket done, all functions are done
harpy-wings Aug 24, 2023
eb92d66
fix formatation
harpy-wings Aug 24, 2023
0be98e3
feat: MULTISig
harpy-wings Aug 26, 2023
a08cfa3
WIP
harpy-wings Aug 26, 2023
046c72f
wip
harpy-wings Aug 26, 2023
1b974f2
wip
harpy-wings Aug 26, 2023
aee0e53
wip
harpy-wings Aug 26, 2023
1fa3ae7
add ICO
harpy-wings Aug 26, 2023
723a26d
ICO WIP
harpy-wings Aug 26, 2023
fa4b999
wip
harpy-wings Aug 30, 2023
59c6825
wip
harpy-wings Aug 30, 2023
f74843b
wip
harpy-wings Sep 1, 2023
25ddea4
wip
harpy-wings Sep 2, 2023
dc35f6b
wip
harpy-wings Sep 4, 2023
3ef06c5
feat: add multiSig contract
harpy-wings Sep 23, 2023
cc0f96c
feat: fix the SubmitTransaction Event
harpy-wings Sep 23, 2023
549b6a6
feat: update repo
harpy-wings Sep 23, 2023
03701b3
add comments
harpy-wings Sep 23, 2023
429f8f3
add some comments
harpy-wings Sep 23, 2023
1c5d6ae
feat: add comments for thevariables
harpy-wings Sep 23, 2023
c0b1358
remove unused code
harpy-wings Sep 23, 2023
4b37580
fix the setAssitants of ECTA
harpy-wings Sep 23, 2023
cd80361
feat: fix unit test and fix issues
harpy-wings Sep 23, 2023
e009aa2
feat: WIP
harpy-wings Sep 23, 2023
6f2995e
feat: add github workflow for Quality gate check
harpy-wings Sep 23, 2023
3756d39
feat: add sonar config
harpy-wings Sep 23, 2023
c4ba224
add exclusions
harpy-wings Sep 23, 2023
2984c94
remove faq
harpy-wings Sep 23, 2023
4dab0f7
wip
harpy-wings Sep 23, 2023
e34f98c
fix issues , WIP
harpy-wings Sep 23, 2023
ebb01f1
close ICO
harpy-wings Sep 23, 2023
6558813
wip
harpy-wings Sep 24, 2023
10a40aa
wip
harpy-wings Sep 24, 2023
24f622a
feat: fix ICO active price
harpy-wings Sep 24, 2023
c4522f2
wip
harpy-wings Sep 24, 2023
e4306c4
wip
harpy-wings Sep 24, 2023
0579d39
doc: add comments to ICO
harpy-wings Sep 24, 2023
8e96655
create Ownable account
harpy-wings Sep 24, 2023
21dd816
fix the ECTA issues
harpy-wings Sep 24, 2023
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
1,552 changes: 1,552 additions & 0 deletions .deps/npm/hardhat/console.sol

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions .deps/remix-tests/remix_accounts.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.4.22 <0.9.0;

library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;

accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;

accounts[2] = 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db;

accounts[3] = 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB;

accounts[4] = 0x617F2E2fD72FD9D5503197092aC168c91465E7f2;

accounts[5] = 0x17F6AD8Ef982297579C203069C1DbfFE4348c372;

accounts[6] = 0x5c6B0f7Bf3E7ce046039Bd8FABdfD3f9F5021678;

accounts[7] = 0x03C6FcED478cBbC9a4FAB34eF9f40767739D1Ff7;

accounts[8] = 0x1aE0EA34a72D944a8C7603FfB3eC30a6669E454C;

accounts[9] = 0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC;

accounts[10] = 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c;

accounts[11] = 0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C;

accounts[12] = 0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB;

accounts[13] = 0x583031D1113aD414F02576BD6afaBfb302140225;

accounts[14] = 0xdD870fA1b7C4700F2BD7f44238821C26f7392148;
return accounts[index];
}
}
225 changes: 225 additions & 0 deletions .deps/remix-tests/remix_tests.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.4.22 <0.9.0;

library Assert {

event AssertionEvent(
bool passed,
string message,
string methodName
);

event AssertionEventUint(
bool passed,
string message,
string methodName,
uint256 returned,
uint256 expected
);

event AssertionEventInt(
bool passed,
string message,
string methodName,
int256 returned,
int256 expected
);

event AssertionEventBool(
bool passed,
string message,
string methodName,
bool returned,
bool expected
);

event AssertionEventAddress(
bool passed,
string message,
string methodName,
address returned,
address expected
);

event AssertionEventBytes32(
bool passed,
string message,
string methodName,
bytes32 returned,
bytes32 expected
);

event AssertionEventString(
bool passed,
string message,
string methodName,
string returned,
string expected
);

event AssertionEventUintInt(
bool passed,
string message,
string methodName,
uint256 returned,
int256 expected
);

event AssertionEventIntUint(
bool passed,
string message,
string methodName,
int256 returned,
uint256 expected
);

function ok(bool a, string memory message) public returns (bool result) {
result = a;
emit AssertionEvent(result, message, "ok");
}

function equal(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventUint(result, message, "equal", a, b);
}

function equal(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventInt(result, message, "equal", a, b);
}

function equal(bool a, bool b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventBool(result, message, "equal", a, b);
}

// TODO: only for certain versions of solc
//function equal(fixed a, fixed b, string message) public returns (bool result) {
// result = (a == b);
// emit AssertionEvent(result, message);
//}

// TODO: only for certain versions of solc
//function equal(ufixed a, ufixed b, string message) public returns (bool result) {
// result = (a == b);
// emit AssertionEvent(result, message);
//}

function equal(address a, address b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventAddress(result, message, "equal", a, b);
}

function equal(bytes32 a, bytes32 b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventBytes32(result, message, "equal", a, b);
}

function equal(string memory a, string memory b, string memory message) public returns (bool result) {
result = (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)));
emit AssertionEventString(result, message, "equal", a, b);
}

function notEqual(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventUint(result, message, "notEqual", a, b);
}

function notEqual(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventInt(result, message, "notEqual", a, b);
}

function notEqual(bool a, bool b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventBool(result, message, "notEqual", a, b);
}

// TODO: only for certain versions of solc
//function notEqual(fixed a, fixed b, string message) public returns (bool result) {
// result = (a != b);
// emit AssertionEvent(result, message);
//}

// TODO: only for certain versions of solc
//function notEqual(ufixed a, ufixed b, string message) public returns (bool result) {
// result = (a != b);
// emit AssertionEvent(result, message);
//}

function notEqual(address a, address b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventAddress(result, message, "notEqual", a, b);
}

function notEqual(bytes32 a, bytes32 b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventBytes32(result, message, "notEqual", a, b);
}

function notEqual(string memory a, string memory b, string memory message) public returns (bool result) {
result = (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b)));
emit AssertionEventString(result, message, "notEqual", a, b);
}

/*----------------- Greater than --------------------*/
function greaterThan(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a > b);
emit AssertionEventUint(result, message, "greaterThan", a, b);
}

function greaterThan(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a > b);
emit AssertionEventInt(result, message, "greaterThan", a, b);
}
// TODO: safely compare between uint and int
function greaterThan(uint256 a, int256 b, string memory message) public returns (bool result) {
if(b < int(0)) {
// int is negative uint "a" always greater
result = true;
} else {
result = (a > uint(b));
}
emit AssertionEventUintInt(result, message, "greaterThan", a, b);
}
function greaterThan(int256 a, uint256 b, string memory message) public returns (bool result) {
if(a < int(0)) {
// int is negative uint "b" always greater
result = false;
} else {
result = (uint(a) > b);
}
emit AssertionEventIntUint(result, message, "greaterThan", a, b);
}
/*----------------- Lesser than --------------------*/
function lesserThan(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a < b);
emit AssertionEventUint(result, message, "lesserThan", a, b);
}

function lesserThan(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a < b);
emit AssertionEventInt(result, message, "lesserThan", a, b);
}
// TODO: safely compare between uint and int
function lesserThan(uint256 a, int256 b, string memory message) public returns (bool result) {
if(b < int(0)) {
// int is negative int "b" always lesser
result = false;
} else {
result = (a < uint(b));
}
emit AssertionEventUintInt(result, message, "lesserThan", a, b);
}

function lesserThan(int256 a, uint256 b, string memory message) public returns (bool result) {
if(a < int(0)) {
// int is negative int "a" always lesser
result = true;
} else {
result = (uint(a) < b);
}
emit AssertionEventIntUint(result, message, "lesserThan", a, b);
}
}
20 changes: 20 additions & 0 deletions .github/workflows/cicd_v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Quality Gate
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
old
artifacts
node_modules
node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Hardhat files
cache
artifacts

38 changes: 38 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.yml",
"options": {}
},
{
"files": "*.yaml",
"options": {}
},
{
"files": "*.toml",
"options": {}
},
{
"files": "*.json",
"options": {}
},
{
"files": "*.js",
"options": {}
},
{
"files": "*.ts",
"options": {}
}
]
}
3 changes: 3 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
configureYulOptimizer: true,
};
30 changes: 30 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# Contracts

is the smart contracts repository of echotrade

REMIX DEFAULT WORKSPACE

Remix default workspace is present when:
i. Remix loads for the very first time
ii. A new workspace is created with 'Default' template
iii. There are no files existing in the File Explorer

This workspace contains 3 directories:

1. 'contracts': Holds three contracts with increasing levels of complexity.
2. 'scripts': Contains four typescript files to deploy a contract. It is explained below.
3. 'tests': Contains one Solidity test file for 'Ballot' contract & one JS test file for 'Storage' contract.

SCRIPTS

The 'scripts' folder has four typescript files which help to deploy the 'Storage' contract using 'web3.js' and 'ethers.js' libraries.

For the deployment of any other contract, just update the contract's name from 'Storage' to the desired contract and provide constructor arguments accordingly
in the file `deploy_with_ethers.ts` or `deploy_with_web3.ts`

In the 'tests' folder there is a script containing Mocha-Chai unit tests for 'Storage' contract.

To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.

Please note, require/import is supported in a limited manner for Remix supported modules.
For now, modules supported by Remix are ethers, web3, swarmgw, chai, multihashes, remix and hardhat only for hardhat.ethers object/plugin.
For unsupported modules, an error like this will be thrown: '<module_name> module require is not supported by Remix IDE' will be shown.

Loading