This branch builds off of CoinAlpha's base Basket Protocol.
Name | Description |
---|---|
Basket Protocol | CoinAlpha's Basket Protocol used as a base for this repo. For more information on the protocol's base functions, please go to the Basket Protocol repo. |
CoinAlpha Releases KYC-Enabled Version of Basket Protocol | Blog post discussing regulatory considerations and motivation for the creation of this KYC Version of the Basket Protocol. |
KYC.sol | A new smart contract module introduced in this version of the Basket Protocol that implements whitelisting rules and functionality. |
KYC Admin |
Ethereum address of a user, who in addition to the protocol creator/administrator, has the ability to whitelist Ethereum addresses. |
This KYC version of the Basket Protocol adds whitelisting functionality: a protocol administrator (owner
) and another authorized party, the KYC Admin
, have the ability to whitelist Ethereum addresses that will be permitted to hold Basket Tokens.
Only Ethereum addresses that have been whitelisted will be able to hold Basket Tokens; any transfers to or transactions that would involve a transfer to a non-whitelisted address are not permitted and will fail.
The KYC.sol contract is introduced in this version of the Basket Protocol to implement the whitelisting functionality.
The main functions are summarized below:
// Query if an address is whitelisted
function isWhitelistedHolder(address _holder) public view returns (bool)
// Function to whitelist an Ethereum address
function whitelistHolder(address _addressToWhitelist) public onlyOwnerOrAdmin returns (bool)
// Function to remove an address from the whitelist
function unWhitelistHolder(address _addressToUnwhitelist) public onlyOwnerOrAdmin returns (bool)
Dependencies on KYC.sol
The contracts which involve potential transfers of Baskets Tokens (namely Basket.sol and, indirectly, BasketEscrow.sol - via its interaction with Basket.sol) connect to KYC.sol to verify validity of the recipient Ethereum address.
$ truffle install -g truffe@4.1.5
Truffle v4.1.5 (core: 4.1.5)
Solidity v0.4.21 (solc-js)
Run test
$ npm test
Running test coverage (solidity-coverage)
# Requires environment variable TEST_COVERAGE=true, which is set in the npm script:
npm run coverage
- Specify
DEPLOYER_ADDRESS
andKYC_ADMIN
address in config.js
# Ropsten Deployment
npm run deploy:ropsten
# Mainnet Deployment
npm run deploy:mainnet
The CoinAlpha team, to the extent possible, aims to follow industry best practices and keep up to date with the rapidly developing field of smart contracts and blockchain engineering. Some of the guides and best practices followed include:
- OpenZeppelin contracts: the Basket Protocol uses some of the standardized and widely accepted OpenZeppelin contracts
- ConsenSys: Smart Contract Security Best Practices
We are also running a bug bounty program. If you find a security issue, please email dev@coinalpha.com. For more information on the Bug Bounty program, click here: Basket Protocol Bug Bounty Program
- Contributing: git workflow
We welcome code contributions (via pull requests) as well as bug reports and feature requests through github issues. You may also contact us by email.
The Basket Protocol was created by CoinAlpha. You can contact us at dev@coinalpha.com.
Code released under the Apache-2.0 License.