Skip to content

Commit

Permalink
Update readme, minor refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroblood-io committed Jul 5, 2020
1 parent 10c538c commit 9a1fa5e
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 169 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@
[![Twitter Follow](https://badgen.net/twitter/follow/DeFiNFT?icon=twitter)](https://twitter.com/intent/follow?screen_name=DeFiNFT)
[![built-with openzeppelin](https://img.shields.io/badge/built%20with-OpenZeppelin-3677FF)](https://docs.openzeppelin.com/)

[![Coverage Status](https://coveralls.io/repos/github/robsecord/ChargedParticlesEth/badge.svg?branch=master)](https://coveralls.io/github/robsecord/ChargedParticlesEth?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/robsecord/ChargedParticlesEth/badge.svg?branch=master)](https://coveralls.io/github/robsecord/ChargedParticlesEth?branch=master&v=123)
![GitHub last commit](https://img.shields.io/github/last-commit/robsecord/ChargedParticlesEth)
![GitHub package.json version](https://img.shields.io/github/package-json/v/robsecord/ChargedParticlesEth)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/robsecord/ChargedParticlesEth)
Expand Down
15 changes: 0 additions & 15 deletions contracts/ChargedParticlesEscrowManager.sol
Expand Up @@ -338,8 +338,6 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
return _isContractOwner(_account, _contract);
}

// You never use this!

/**
* @notice Registers a external ERC-721 Contract in order to define Custom Rules for Tokens
* @param _contractAddress The Address to the External Contract of the Token
Expand All @@ -360,8 +358,6 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
emit RegisterParticleContract(_contractAddress);
}

// You never use this!

/**
* @notice Registers the "Release-Burn" Custom Rule on an external ERC-721 Token Contract
* When enabled, tokens that are "Charged" will require the Token to be Burned before
Expand All @@ -377,8 +373,6 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
customReleaseRequiresBurn[_contractAddress] = _releaseRequiresBurn;
}

// You never use this!

/**
* @notice Registers the "Asset-Pair" Custom Rule on an external ERC-721 Token Contract
* The Asset-Pair Rule defines which Asset-Token & Interest-bearing Token Pair can be used to
Expand All @@ -399,8 +393,6 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
customAssetPairId[_contractAddress] = _assetPairId;
}

// You never use this!

/**
* @notice Registers the "Deposit Fee" Custom Rule on an external ERC-721 Token Contract
* When set, every Token of the Custom ERC-721 Contract that is "Energized" pays a Fee to the
Expand All @@ -418,8 +410,6 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
customAssetDepositFee[_contractAddress] = _depositFee;
}

// You never use this!

/**
* @notice Registers the "Minimum Deposit Amount" Custom Rule on an external ERC-721 Token Contract
* When set, every Token of the Custom ERC-721 Contract must be "Energized" with at least this
Expand All @@ -435,8 +425,6 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
customAssetDepositMin[_contractAddress] = _minDeposit;
}

// You never use this!

/**
* @notice Registers the "Maximum Deposit Amount" Custom Rule on an external ERC-721 Token Contract
* When set, every Token of the Custom ERC-721 Contract must be "Energized" with at most this
Expand Down Expand Up @@ -504,10 +492,7 @@ contract ChargedParticlesEscrowManager is IChargedParticlesEscrowManager, Initia
nonReentrant
returns (uint256)
{
// require(_isNonFungibleToken(_contractAddress, _tokenId), "CPEM: INVALID_TYPE");
require(_isAssetPairEnabled(_assetPairId), "CPEM: INVALID_ASSET_PAIR");

// When and where should someone use escrowMgr.registerContractType(...) ?
require(customRegisteredContract[_contractAddress], "CPEM: UNREGISTERED");

// Get Escrow for Asset
Expand Down
4 changes: 4 additions & 0 deletions deploy/initialize.js
Expand Up @@ -80,6 +80,10 @@ module.exports = async (bre) => {
await ChaiEscrow.setPausedState(false)
await ChargedParticles.setPausedState(false)

// log("\n Minting ION Tokens...")
// const ionToken = presets.ChargedParticles.ionToken
// await ChargedParticles.mintIons(ionToken.URI, ionToken.maxSupply, ionToken.mintFee)

// Display Contract Addresses
log("\n Contract Deployments Complete!\n\n Contracts:")
log(" - ChaiEscrow: ", ChaiEscrow.address)
Expand Down
40 changes: 39 additions & 1 deletion test/ChargedParticles.test.js
Expand Up @@ -217,7 +217,45 @@ describe('ChargedParticles Contract', function () {

});

});


// it.only('withdrawFees', async () => {
// const balanceBefore1 = await web3.eth.getBalance(ionHodler);
// const receipt1 = await contractInstance.methods.withdrawFees(ionHodler).send({ from: owner, gas: 5e6 });
// const balanceAfter1 = await web3.eth.getBalance(ionHodler);

// expectEvent(receipt1, 'ContractFeesWithdrawn', {
// _sender: owner,
// _receiver: ionHodler,
// _amount: '0'
// });
// expect((balanceAfter1 - balanceBefore1).toString()).toBe('0');

// await contractInstance.methods.mintPlasma(ionHodler, ionTokenId, 3, []).send({ from: nonOwner, gas: 5e6, value: web3.utils.toWei('5', 'ether') });

// const balanceBefore2 = await web3.eth.getBalance(ionHodler);
// const receipt2 = await contractInstance.methods.withdrawFees(ionHodler).send({ from: owner, gas: 5e6 });
// const balanceAfter2 = await web3.eth.getBalance(ionHodler);

// expectEvent(receipt2, 'ContractFeesWithdrawn', {
// _sender: owner,
// _receiver: ionHodler,
// _amount: web3.utils.toWei('3', 'ether').toString()
// });
// expect(web3.utils.fromWei((balanceAfter2 - balanceBefore2).toString(), 'ether')).toBe('3');

// const balanceBefore3 = await web3.eth.getBalance(ionHodler);
// const receipt3 = await contractInstance.methods.withdrawFees(ionHodler).send({ from: owner, gas: 5e6 });
// const balanceAfter3 = await web3.eth.getBalance(ionHodler);

// expectEvent(receipt3, 'ContractFeesWithdrawn', {
// _sender: owner,
// _receiver: ionHodler,
// _amount: '0'
// });
// expect((balanceAfter3 - balanceBefore3).toString()).toBe('0');
// });
});

});

Expand Down

0 comments on commit 9a1fa5e

Please sign in to comment.