Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

KYC Verification EOA Check #14

Open
everhusk opened this issue Jan 22, 2018 · 7 comments
Open

KYC Verification EOA Check #14

everhusk opened this issue Jan 22, 2018 · 7 comments

Comments

@everhusk
Copy link
Contributor

Allow an easy way for KYC providers to verify if an address being requested for verification is a EOA/contract address or not.

@adamdossa
Copy link

FYI - function to do this from web3 is:
web3.eth.getCode

@pabloruiz55
Copy link

@adamdossa right.
@everhusk for checking so within Solidity it can be done like this:

function isContract(address _addr) private returns (bool is_contract) {
      uint length;
      assembly {
            //retrieve the size of the code on target address, this needs assembly
            length := extcodesize(_addr)
      }
      return (length>0);
    }

@ChainSafeSystems
Copy link
Contributor

@GregTheGreek please take a look at this when you have a chance.

@GregTheGreek
Copy link
Contributor

GregTheGreek commented Jan 28, 2018

@adamdossa @pabloruiz55 @ChainSafe Thoughts on adding this into template.js (wrapper)? That way we can just call web3.eth.getCode and all the contracts will have access?

Edit:
Template.js, since there is no reason to add a constant or anything on solidity

@adamdossa
Copy link

What would be the logic if it is a contract address? There are some cases where I could imagine a KYC provider wanting to be able to whitelist an address (many current ICOs do allow this), although perhaps it may require some extra diligence, and possibly a higher fee (or this may not be feasible for current KYC approaches). Either way, I think if we do this check we could either just display it as information to the KYC provider, but I don't think we want to hardcode disallowing contract addresses at the Solidity end.

@pabloruiz55
Copy link

I guess that the idea is to at least give the KYC provider some quick info about the address.
It would be up to them to decide if they don't want to approve a contract address.

We can't ban it from the get-go as an address containing code could be a multsig wallet.
There's also the case of forbidding a contract address, as it could be an investment pool contract trying to get into an STO.

I see no problem in adding that function to the wrapper, but we have to be very careful in how we allow people to use it.

@ChainSafeSystems
Copy link
Contributor

It's gonna be a v1 stretch goal - 100% for v2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants