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

Token: Maintain ERC and EIP traits for Token Compatibility #1299

Closed
jochasinga opened this issue Feb 20, 2021 · 0 comments
Closed

Token: Maintain ERC and EIP traits for Token Compatibility #1299

jochasinga opened this issue Feb 20, 2021 · 0 comments
Labels
stale [bot only] Added to stale content; will be closed soon

Comments

@jochasinga
Copy link

What
Keeping up with the Ethereum technical standard by maintaining equivalent Rust traits in the program library.

Why
Solana has several advantages over Ethereum. By maintaining ERC and EIP API it can be easier for Ethereum
developers to transition to Solana.

Additionally, security token standards such as

EIP 1400: Security Token Standard
EIP 1410: Partially Fungible Token Standard

can be a pathway to a well-implemented #966 (vesting contract feature request) as well as a more sustainable adoption of Solana as security token infrastructure since it is already equipped for uses in exchanges.

How
For starters, keeping a Rust trait like:

trait ERC20 {
        // Optional methods                                                                        

        // fn name(&self) -> String;                                                               
	// fn symbol(&self) -> String;                                                             
        // fn decimals(&self) -> u8;                                                               

        fn total_supply(&self) -> usize;

        fn balance_of(address: &Pubkey) -> usize;

	fn transfer(to: &Pubkey, value: usize) -> Result<(), Option<&str>>;

	fn transfer_from(from: &Pubkey, to: &Pubkey, value: usize) -> Result<(), Option<&str>>;

	fn approve(spender: &Pubkey, value: usize) -> Result<(), Option<&str>>;

	fn allowance(owner: &Pubkey, spender: &Pubkey) -> usize;
}

This can be added as an additional module of the program library with ease.

jochasinga added a commit to firmalabs/solana-program-library that referenced this issue Feb 20, 2021
Add an ethereum module to the program library module, including
a preliminary ERC20 trait.

See issue on main repo: solana-labs#1299
@github-actions github-actions bot added the stale [bot only] Added to stale content; will be closed soon label Aug 10, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale [bot only] Added to stale content; will be closed soon
Projects
None yet
Development

No branches or pull requests

1 participant