2018-10-08 20:41:31 -07:00
|
|
|
//! ERC20-like Token program
|
2018-11-02 17:32:54 -07:00
|
|
|
use native_loader;
|
2018-10-25 11:13:08 -07:00
|
|
|
use solana_sdk::account::Account;
|
|
|
|
use solana_sdk::pubkey::Pubkey;
|
2018-10-08 20:41:31 -07:00
|
|
|
|
2018-11-02 17:32:54 -07:00
|
|
|
const ERC20_NAME: &str = "solana_erc20";
|
|
|
|
const ERC20_PROGRAM_ID: [u8; 32] = [
|
2018-10-26 19:44:53 -07:00
|
|
|
131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0,
|
2018-10-08 20:41:31 -07:00
|
|
|
];
|
|
|
|
|
2018-11-02 17:32:54 -07:00
|
|
|
pub fn id() -> Pubkey {
|
|
|
|
Pubkey::new(&ERC20_PROGRAM_ID)
|
2018-10-08 20:41:31 -07:00
|
|
|
}
|
|
|
|
|
2018-11-05 09:47:41 -08:00
|
|
|
pub fn account() -> Account {
|
|
|
|
Account {
|
|
|
|
tokens: 0,
|
|
|
|
program_id: id(),
|
|
|
|
userdata: ERC20_NAME.as_bytes().to_vec(),
|
|
|
|
executable: true,
|
|
|
|
loader_program_id: native_loader::id(),
|
|
|
|
}
|
2018-10-08 20:41:31 -07:00
|
|
|
}
|