Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e800292
feat: fractionalization impl
petermunachi Dec 16, 2024
92fcb4f
Update VERIFY_TOKEN.md
petermunachi Dec 16, 2024
9325945
fix: changing contract to modular structure
petermunachi Dec 22, 2024
90c6840
fix: resolving merge conflict
petermunachi Dec 22, 2024
fa2e629
Merge pull request #2 from SkyTradeLinks/feat-frac-modular-structure
petermunachi Dec 22, 2024
057504f
feat: KYC and whitelisting compliance contract
petermunachi Mar 18, 2025
e2f7675
fix: adding subgraph changes
petermunachi Apr 18, 2025
f13e2e2
fix: adding plume configuration
petermunachi Apr 21, 2025
4b729cb
fix: adding subgraph
petermunachi May 2, 2025
f9df510
feat: adding merkle tree whitelisting support
petermunachi May 14, 2025
4055249
fix: subgraph fix
petermunachi May 20, 2025
6130eb6
feat: add tests for external contracts
manoranjith-shankar Jun 4, 2025
2f5531d
Merge pull request #15 from SkyTradeLinks/external-tests
petermunachi Jun 5, 2025
b2f1231
feat: adding kyc merkle tree whitelisting
Jun 6, 2025
a261844
feat: removing redundant changes
Jun 6, 2025
e65ab8e
feat: add tests for trading restriction manager
manoranjith-shankar Jun 6, 2025
5ea4860
Merge pull request #17 from SkyTradeLinks/audit-tests
petermunachi Jun 6, 2025
7f3e4b8
hotfix: update test cases
manoranjith-shankar Jun 6, 2025
c03e663
feat: contract upgrades
manoranjith-shankar Jun 6, 2025
bf766b7
upgrade: trading restriction manager
manoranjith-shankar Jun 6, 2025
9571857
wip: contracts upgrade
manoranjith-shankar Jun 6, 2025
23b0ecd
wip: compiled contracts update for 0.8.30
manoranjith-shankar Jun 9, 2025
5747468
wip: token contract upgrade
manoranjith-shankar Jun 9, 2025
97b05d6
wip: token upgrade
manoranjith-shankar Jun 9, 2025
df13e20
upgrade: external contracts
manoranjith-shankar Jun 9, 2025
84a6e9e
update: contract to using ownable from openzepplin
manoranjith-shankar Jun 9, 2025
0950793
Merge pull request #20 from SkyTradeLinks/external-contract-upgrades
petermunachi Jun 11, 2025
7a9dc39
fix: upgrade fix
Jun 13, 2025
fe9d1da
fix: contract upgrade
Jun 13, 2025
a78b4b3
temp: add tests and upgraded contracts
manoranjith-shankar Jun 13, 2025
e277d11
update: replace contract-hardhat with upgraded contracts
manoranjith-shankar Jun 13, 2025
79bfffa
feat: implement MockOracle contract and update oracle registration logic
manoranjith-shankar Jun 13, 2025
105ce0c
fix
Jun 14, 2025
5a364f0
wip: contracts testing
manoranjith-shankar Jun 16, 2025
1818fb1
wip: update tests
manoranjith-shankar Jun 16, 2025
861d1da
wip: contract upgrades
manoranjith-shankar Jun 16, 2025
9bead86
wip: add upgrade tests
manoranjith-shankar Jun 20, 2025
fc55e8c
wip: polymath tests
manoranjith-shankar Jun 20, 2025
c1aec17
wip: contract tests
manoranjith-shankar Jun 22, 2025
c58295b
wip: test updates
manoranjith-shankar Jun 23, 2025
5148e07
wip: contract tests
manoranjith-shankar Jun 23, 2025
5eb5ab5
fix: signature fix
Jun 24, 2025
01ff09a
wip: contract test updates
manoranjith-shankar Jun 24, 2025
a3b7de7
wip: contract tests
manoranjith-shankar Jun 24, 2025
f688e9e
feat: update trading restriction manager
manoranjith-shankar Jun 25, 2025
26c8f7b
feat: update ownable in trading restriction manager
manoranjith-shankar Jun 25, 2025
20e1095
wip: update tests with merkle whitelisting
manoranjith-shankar Jun 26, 2025
96df8b6
feat: usdtieredSTO test update with merkle whitelisting
manoranjith-shankar Jun 27, 2025
7489c21
fix: trading restriction manager test
manoranjith-shankar Jun 27, 2025
a49c1e5
feat: trading restriction manager tests
manoranjith-shankar Jun 27, 2025
a729243
feat: TRM tests
manoranjith-shankar Jun 27, 2025
2961422
feat: update receiveAfter logic
manoranjith-shankar Jun 27, 2025
53046ce
feat: update tests
manoranjith-shankar Jun 30, 2025
722cdee
fix: coverage fix
Jun 30, 2025
3d60dd5
fix: coverage fix
Jun 30, 2025
df4fd63
fix: coverage fix
Jun 30, 2025
1ce5968
update: validation testing cleanup
manoranjith-shankar Jul 2, 2025
6e626eb
feat: add fakeUSDT contract
manoranjith-shankar Jul 3, 2025
c5319da
wip: update solcover for coverage
manoranjith-shankar Jul 3, 2025
5948f48
feat: add investorclass on merkle tree
manoranjith-shankar Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,31 @@ extract.zip
.env
yarn-error.log
polymath-developer-portal

node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Hardhat files
cache
artifacts


contract-hardhat/node_modules
contract-hardhat/.env
contract-hardhat/coverage
contract-hardhat/coverage.json
contract-hardhat/typechain
contract-hardhat/typechain-types
contract-hardhat/generated
contract-hardhat/build
contract-hardhat/subgraph/build

# Hardhat files
contract-hardhat/cache
contract-hardhat/artifacts


1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v10.16.0
41 changes: 35 additions & 6 deletions CLI/commands/common/common_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ async function addModule (securityToken, polyToken, factoryAddress, moduleABI, g
moduleFactory.setProvider(web3.currentProvider);

const moduleName = web3.utils.hexToUtf8(await moduleFactory.methods.name().call());
const setupCostAction = await moduleFactory.methods.changeSetupCost(0)

await this.sendTransaction(setupCostAction, { factor: 2 });

const moduleFee = new web3.utils.BN(await moduleFactory.methods.setupCostInPoly().call());
let transferAmount = new web3.utils.BN(0);
if (moduleFee.gt(new web3.utils.BN(0))) {
Expand Down Expand Up @@ -40,7 +44,7 @@ async function addModule (securityToken, polyToken, factoryAddress, moduleABI, g
let transferEvent = this.getEventFromLogs(polyToken._jsonInterface, transferReceipt.logs, 'Transfer');
console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(transferEvent.value))}`);
}
let addModuleAction = securityToken.methods.addModuleWithLabel(factoryAddress, bytes, moduleFee, 0, moduleLabel, addModuleArchived);
let addModuleAction = securityToken.methods.addModuleWithLabel(factoryAddress, bytes, 0, 0, moduleLabel, addModuleArchived);
let receipt = await this.sendTransaction(addModuleAction);
let event = this.getEventFromLogs(securityToken._jsonInterface, receipt.logs, 'ModuleAdded');
console.log(`${moduleName} deployed at address: ${event._module}`);
Expand Down Expand Up @@ -158,10 +162,16 @@ function getFinalOptions(options) {
};

async function getGasLimit(options, action) {
let block = await web3.eth.getBlock('latest');
let networkGasLimit = block.gasLimit;
let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value })));
return (gas > networkGasLimit) ? networkGasLimit : gas;
try {
let block = await web3.eth.getBlock('latest');
let networkGasLimit = block.gasLimit;
let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value })));
return (gas > networkGasLimit) ? networkGasLimit : gas;
} catch (error) {
console.error('Error getting transaction count:', error);

return 7900000;
}
}

async function checkPermissions(action) {
Expand Down Expand Up @@ -224,15 +234,34 @@ async function selectToken(securityTokenRegistry, tokenSymbol) {
return securityToken;
}

let newNonce = 0;

async function getTransactionCount(address) {
try {
const count = await web3.eth.getTransactionCount(address);

newNonce = count

console.log(`Transaction count for ${address}: ${count}`);
return count;

} catch (error) {
console.error('Error getting transaction count:', error);

return newNonce + 1;
}
}

async function sendTransaction(action, options) {
await checkPermissions(action);

options = getFinalOptions(options);
let gasLimit = await getGasLimit(options, action);
// let gasLimit = 9900000;

console.log(chalk.black.bgYellowBright(`---- Transaction executed: ${action._method.name} - Gas limit provided: ${gasLimit} ----`));

let nonce = await web3.eth.getTransactionCount(options.from.address);
let nonce = await getTransactionCount(options.from.address);
if (nonce < options.minNonce) {
nonce = minNonce;
}
Expand Down
11 changes: 10 additions & 1 deletion CLI/commands/common/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ function getGasPrice(networkId) {
case 15: //Ganache
gasPrice = 50000000000;
break;
case 1337: //Ganache CLI
gasPrice = 50000000000;
break;
case 42: //Kovan
gasPrice = 50000000000;
break;
case 56: // BSC Mainnet
gasPrice = 50000000000;
break;
case 97: // BSC Testnet
gasPrice = 50000000000;
break;
default:
throw new Error('Network ID not identified');
}
Expand Down Expand Up @@ -82,7 +91,7 @@ module.exports = {
Issuer = getAccount(`${__dirname}/../../../keyStore`);
} else {
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
Issuer = getAccount(`${__dirname}/../../../keyStoreLocal`);
Issuer = getAccount(`${__dirname}/keyStoreLocal`);
}
defaultGasPrice = getGasPrice(await web3.eth.net.getId());
}
Expand Down
5 changes: 4 additions & 1 deletion CLI/commands/helpers/contract_addresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ function getPolymathRegistryAddress(networkId) {
case 15: // GANACHE
result = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/PolymathRegistry.json`).toString()).networks[networkId].address;
break;
case 1337: // GANACHE
result = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/PolymathRegistry.json`).toString()).networks[networkId].address;
break;
case 42: // KOVAN
result = "0x5b215a7d39ee305ad28da29bf2f0425c6c2a00b3";
break;
break;
}

return result;
Expand Down
14 changes: 14 additions & 0 deletions contract-hardhat/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Deployment safety-net
# Required for contract deployment
CHAIN_ID=1337

# Required for contract deployment
PROVIDER_URL=http://ganache-cli:8545

# Deployer and initial owner()
# Required for contract deployment
OWNER_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
OWNER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

ETHERSCAN_API_KEY=
COVERAGE=false
17 changes: 17 additions & 0 deletions contract-hardhat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337
1 change: 1 addition & 0 deletions contract-hardhat/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
3 changes: 3 additions & 0 deletions contract-hardhat/.solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
skipFiles: ['flat', 'tokens/FakeUSDT.sol', 'helpers', 'mocks', 'oracles', 'libraries/KindMath.sol', 'libraries/BokkyPooBahsDateTimeLibrary.sol', 'storage', 'modules/Experimental'],
};
Loading