Remove token_program.rs

This commit is contained in:
Michael Vines
2018-12-03 13:56:46 -08:00
parent 63a758508a
commit d010cac8a5
5 changed files with 28 additions and 31 deletions

View File

@ -16,5 +16,5 @@ solana-sdk = { path = "../../../sdk", version = "0.11.0" }
[lib]
name = "solana_erc20"
crate-type = ["cdylib"]
crate-type = ["lib", "cdylib"]

View File

@ -10,12 +10,33 @@ extern crate serde_derive;
#[macro_use]
extern crate solana_sdk;
use solana_sdk::account::KeyedAccount;
use solana_sdk::account::{Account, KeyedAccount};
use solana_sdk::native_loader;
use solana_sdk::pubkey::Pubkey;
use std::sync::{Once, ONCE_INIT};
mod token_program;
const ERC20_NAME: &str = "solana_erc20";
const ERC20_PROGRAM_ID: [u8; 32] = [
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,
];
pub fn id() -> Pubkey {
Pubkey::new(&ERC20_PROGRAM_ID)
}
pub fn account() -> Account {
Account {
tokens: 1,
owner: id(),
userdata: ERC20_NAME.as_bytes().to_vec(),
executable: true,
loader: native_loader::id(),
}
}
solana_entrypoint!(entrypoint);
fn entrypoint(
program_id: &Pubkey,