关于 object owner的疑问,share_object能否把某object从owner的地址下移出? #275
Unanswered
passer-byzhang
asked this question in
Q&A
Replies: 2 comments 2 replies
-
可以试试用 module ds::test {
use sui::object::UID;
use sui::tx_context::TxContext;
use sui::transfer;
use sui::coin::{Self, Coin};
use sui::sui::SUI;
use sui::object;
use std::option;
use std::option::Option;
struct Box<T> has key, store {
id: UID,
reward: Option<T>,
}
public entry fun lock(reward: Coin<SUI>, ctx: &mut TxContext) {
let uid = object::new(ctx);
transfer::share_object(Box {
id: uid,
reward: option::some(coin::into_balance(reward)),
});
}
} 我觉得是因为直接存入 |
Beta Was this translation helpful? Give feedback.
2 replies
-
Add issue to Sui team: issue MystenLabs/sui#7442 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
如题,我试着写了一个Box合约,可以往一个share_object Box里存钱
但是该coin object并没有从我的账户下移出,至少在sui_getObjectsOwnedByAddresss接口是能查到的。
这也就导致了每次调用get_Coins就会再次匹配该object,然后返回一个
导致任何自动设置gas或者计算付款都无法正常使用了
Beta Was this translation helpful? Give feedback.
All reactions