Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Basket Protocol with built in KYC whitelisting functionality

License

Notifications You must be signed in to change notification settings

CoinAlpha/kyc-basket-protocol

Repository files navigation

Basket Protocol: KYC Version

KYC Basket Protocol

Build Status Coverage Status

This branch builds off of CoinAlpha's base Basket Protocol.

Quick Reference

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.

Overview

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.

KYC Whitelist Module

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.


Testing

$ 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

Deployment

  • Specify DEPLOYER_ADDRESS and KYC_ADMIN address in config.js
# Ropsten Deployment
npm run deploy:ropsten
# Mainnet Deployment
npm run deploy:mainnet

Security

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:

🐞 Bug Bounty Program

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

Contributions Are Welcome!

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.

Contact

The Basket Protocol was created by CoinAlpha. You can contact us at dev@coinalpha.com.

License

Code released under the Apache-2.0 License.

About

Basket Protocol with built in KYC whitelisting functionality

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •