Skip to content
/ kyo Public

know-your-origin, don't use this terrible anti-pattern you fool

License

Notifications You must be signed in to change notification settings

dapphub/kyo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

know-your-origin

A base layer for KYC solutions that discriminates by tx.origin instead of msg.sender. Get out of the way and let the developers play!

This is not the right tool for system-level command/control. For that, see dappsys/auth.

How to use

Protect functions with the kyo modifier to do a tx.origin lookup.

function highTrustAction()
    kyo
{
    // You know who is running this code, even if they it was called
    // through intermediate contracts they created independently
}

Contract that use kyo must be initialized with a KYOAuthority reference:

contract MyContract is KYOUser {
    function MyContract( KYOAuthority kyo_auth )
        KYOUser( kyo_auth )
    {
    }
}

Implement your own KYOAuthority, or use the provided examples.

contract KYOAuthority {
    function signerCanRun(address code, bytes4 sig) returns (bool);
}

About

know-your-origin, don't use this terrible anti-pattern you fool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published