【发布时间】:2021-01-15 13:14:39
【问题描述】:
我正在尝试从near-js-api 为我的合同调用以下方法。它将 Rsut AccountId 作为参数。
序列化Account 并将其传递给合约的正确方法是什么?
另外,调用合约初始化器时有什么特别的注意事项吗?
#[near_bindgen]
impl BurnerPool {
#[init]
fn new(token_id: AccountId) -> Self {
assert!(!env::state_exists(), "Already initialized");
let pool = Self {
token_id: token_id,
total_received: 0,
};
return pool;
}
}
【问题讨论】: