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

feat: improved test coverage part two #113

Merged
merged 82 commits into from
Oct 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
fbaded0
renamed folder and changed version
Foivos Jul 6, 2023
8a6d845
npmignore
Foivos Jul 6, 2023
607de5c
npmignore
Foivos Jul 6, 2023
52fc054
Merge remote-tracking branch 'origin/main' into feat/dist
Foivos Jul 6, 2023
f5b5f56
change version
Foivos Jul 6, 2023
4c5738d
using include pattern instead.
Foivos Jul 6, 2023
15e606b
Merge remote-tracking branch 'origin/main' into feat/dist0-1-1
Foivos Jul 6, 2023
d998f1b
Merge branch 'main' into feat/dist0-1-1
Foivos Jul 11, 2023
0548a6e
Fixed most of the things least auhority suggested.
Foivos Jul 11, 2023
8397b07
made lint happy
Foivos Jul 11, 2023
f2e5ea8
Apply suggestions from code review
milapsheth Jul 12, 2023
32ce490
fixed some bugs
Foivos Jul 19, 2023
80616c5
Merge remote-tracking branch 'origin/main' into feat/least-autority-f…
Foivos Jul 19, 2023
dc516fe
added events
Foivos Jul 19, 2023
d6fa384
rename set to transfer for distributor and operator
Foivos Jul 24, 2023
5cc8fbb
changed standardized token to always allow token managers to mint/bur…
Foivos Jul 24, 2023
ea255e0
using immutable storage for remoteAddressValidator address to save gas
Foivos Jul 24, 2023
09bf99a
Merge remote-tracking branch 'origin/main' into feat/gas-optimizations
Foivos Jul 24, 2023
650ca71
Added some recommended changes
Foivos Jul 26, 2023
c69e0a4
added milap's suggested changes
Foivos Jul 26, 2023
63a18e4
Merge remote-tracking branch 'origin/main' into feat/gas-optimizations
Foivos Jul 26, 2023
2993930
Fixed some names and some minor gas optimizations
Foivos Jul 26, 2023
9074ed1
prettier and lint
Foivos Jul 26, 2023
d3cb150
stash
Foivos Jul 27, 2023
53fe6fe
import .env in hardhat.config
Foivos Jul 27, 2023
7eb5207
trying to fix .env.example
Foivos Jul 27, 2023
bf603eb
Added some getters in IRemoteAddressValidator and removed useless che…
Foivos Jul 27, 2023
f1723c3
removed ternary operators
Foivos Jul 27, 2023
bc8ed59
made lint happy
Foivos Jul 27, 2023
7661e1f
Merge branch 'feat/gas-optimizations' into feat/use-create3-lib
Foivos Jul 27, 2023
4bf89db
made lint happy
Foivos Jul 27, 2023
512d126
Added a new token manager to handle fee on transfer and added some te…
Foivos Jul 27, 2023
9e43b1c
fixed the liquidity pool check.
Foivos Jul 28, 2023
ba29a2a
Merge remote-tracking branch 'origin/main' into feat/use-create3-lib
Foivos Jul 28, 2023
1e2aeb3
fix a duplication bug
Foivos Jul 28, 2023
6c62270
lint
Foivos Jul 28, 2023
30c1e53
added some more tests
Foivos Jul 28, 2023
51b70c1
Added more tests
Foivos Jul 28, 2023
6b3f5ed
Merge branch 'feat/use-create3-lib' into feat/fee-on-transfer-separate
Foivos Jul 28, 2023
3e6d85f
Added proper re-entrancy protection for fee on transfer token managers.
Foivos Jul 28, 2023
d4075b8
change to tx.origin for refunds
Foivos Jul 28, 2023
5d9d8ce
Added support for more kinds of addresses.
Foivos Jul 28, 2023
1b35cbf
some minor gas opts
Foivos Jul 28, 2023
412dce9
some more gas optimizations.
Foivos Jul 28, 2023
0a8519f
Added a getter for chain name to the remote address validator.
Foivos Jul 28, 2023
959e495
moved the tokenManager getter functionality to a separate contract wh…
Foivos Jul 28, 2023
0d09703
made lint happy
Foivos Jul 28, 2023
2e44518
Removed tokenManagerGetter and put params into tokenManagers
Foivos Jul 28, 2023
6027ffe
Added separate tokenManager interfaces
Foivos Jul 28, 2023
04041d1
addressed ackeeblockchains's 3.0 report
Foivos Aug 23, 2023
6ee5d06
prettier
Foivos Aug 23, 2023
5acf4a8
added interchain transfer methods to the service and unified receivin…
Foivos Aug 28, 2023
244ff61
made lint happy
Foivos Aug 28, 2023
4e56576
rename sendToken to interchainTransfer
Foivos Aug 29, 2023
a8dc8a4
changed sendToken everywhere
Foivos Aug 29, 2023
b210316
changed from uint256.max to a const
Foivos Aug 30, 2023
2f5adac
change setting to zero to delete for storage slots.
Foivos Sep 4, 2023
af4766a
rearange storage variables to save a bit of gas.
Foivos Sep 4, 2023
634581c
Removed unecesairy casts
Foivos Sep 4, 2023
141648b
made as many event params inexed as possible
Foivos Sep 4, 2023
602d531
Removed unused imports
Foivos Sep 4, 2023
0ec429e
domain separator is calculated each time.
Foivos Sep 4, 2023
f089d50
added some natspec
Foivos Sep 4, 2023
8053c76
added an example for using pre-existing custom tokens.
Foivos Sep 7, 2023
c19ec5a
added a comment
Foivos Sep 7, 2023
80f7637
feat: improved test coverage part one
Sep 28, 2023
4582807
feat: live testnet support
Oct 2, 2023
a18be9c
fix: remove exclusive mocha test
Oct 2, 2023
5cc9de0
fix: remove hardcoded gas options
Oct 2, 2023
0faf7a2
feat: increased test coverage part two
Oct 2, 2023
d7216ce
fix: remove comment
Oct 2, 2023
67f5f9b
feat: add test
Oct 2, 2023
357f425
Merge branch 'main' into feat/test-coverage-one
re1ro Oct 3, 2023
a5fe901
fix(InvalidStandardizedToken): imports
re1ro Oct 3, 2023
5a89f3d
Merge branch 'feat/test-coverage-one' into feat/test-coverage-two
re1ro Oct 3, 2023
95dc1df
feat: address comments
Oct 5, 2023
a2106e3
fix: ITS tests
Oct 6, 2023
8fb7b79
Merge branch 'main' into feat/test-coverage-one
milapsheth Oct 9, 2023
494a521
Merge branch 'feat/test-coverage-one' into feat/test-coverage-two
Oct 10, 2023
25765d3
fix: tests
Oct 10, 2023
b8c2889
fix: remove broken test
Oct 10, 2023
d3a053e
Merge branch 'main' into feat/test-coverage-two
milapsheth Oct 12, 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
Prev Previous commit
Next Next commit
made lint happy
Foivos committed Jul 27, 2023
commit 4bf89dba8ac5793fcb04f5b283bee8537739e21f
7 changes: 4 additions & 3 deletions contracts/interfaces/IStandardizedTokenDeployer.sol
Original file line number Diff line number Diff line change
@@ -11,15 +11,16 @@ import { Create3Deployer } from '@axelar-network/axelar-gmp-sdk-solidity/contrac
interface IStandardizedTokenDeployer {
error AddressZero();
error TokenDeploymentFailed();

/**
* @notice Returns the standardized token implementation address
*/
function implementationAddress() external view returns(address);
*/
function implementationAddress() external view returns (address);

/**
* @notice Returns the standardized token deployment address.
* @return tokenAddress the token address.
*/
*/
function deployedAddress(bytes32 salt) external view returns (address tokenAddress);

/**
4 changes: 1 addition & 3 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
@@ -82,9 +82,7 @@ async function deployAll(wallet, chainName, deploymentKey = 'interchainTokenServ
const gasService = await deployGasService(wallet);
const tokenManagerDeployer = await deployContract(wallet, 'TokenManagerDeployer', []);
const standardizedToken = await deployContract(wallet, 'StandardizedToken');
const standardizedTokenDeployer = await deployContract(wallet, 'StandardizedTokenDeployer', [
standardizedToken.address,
]);
const standardizedTokenDeployer = await deployContract(wallet, 'StandardizedTokenDeployer', [standardizedToken.address]);
const interchainTokenServiceAddress = await getCreate3Address(create3Deployer.address, wallet, deploymentKey);
const remoteAddressValidator = await deployRemoteAddressValidator(wallet, interchainTokenServiceAddress);
const tokenManagerImplementations = await deployTokenManagerImplementations(wallet, interchainTokenServiceAddress);
3 changes: 1 addition & 2 deletions test/tokenServiceFullFlow.js
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ const { AddressZero } = ethers.constants;
const { defaultAbiCoder, keccak256 } = ethers.utils;
const { Contract, Wallet } = ethers;

const IStandardizedTokenDeployer = require('../artifacts/contracts/interfaces/IStandardizedTokenDeployer.sol/IStandardizedTokenDeployer.json');
const IStandardizedToken = require('../artifacts/contracts/interfaces/IStandardizedToken.sol/IStandardizedToken.json');
const ITokenManager = require('../artifacts/contracts/interfaces/ITokenManager.sol/ITokenManager.json');

@@ -45,7 +44,7 @@ describe('Interchain Token Service', () => {

before(async () => {
// The below is used to deploy a token, but any ERC20 can be used instead.
token = await deployContract(wallet, 'InterchainTokenTest', [name, symbol, decimals, wallet.address])
token = await deployContract(wallet, 'InterchainTokenTest', [name, symbol, decimals, wallet.address]);
tokenId = await service.getCanonicalTokenId(token.address);
const tokenManagerAddress = await service.getTokenManagerAddress(tokenId);
await (await token.mint(wallet.address, tokenCap)).wait();
6 changes: 2 additions & 4 deletions test/utils.js
Original file line number Diff line number Diff line change
@@ -344,7 +344,7 @@ describe('Pausable', () => {
});

describe('StandardizedTokenDeployer', () => {
let create3Deployer, standardizedToken, standardizedTokenDeployer;
let standardizedToken, standardizedTokenDeployer;
const tokenManager = new Wallet(getRandomBytes32()).address;
const mintTo = new Wallet(getRandomBytes32()).address;
const name = 'tokenName';
@@ -354,9 +354,7 @@ describe('StandardizedTokenDeployer', () => {

before(async () => {
standardizedToken = await deployContract(ownerWallet, 'StandardizedToken');
standardizedTokenDeployer = await deployContract(ownerWallet, 'StandardizedTokenDeployer', [
standardizedToken.address,
]);
standardizedTokenDeployer = await deployContract(ownerWallet, 'StandardizedTokenDeployer', [standardizedToken.address]);
});

it('Should deploy a mint burn token only once', async () => {