MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / CocoonWallet

Method CocoonWallet

runners/smartcontracts/CocoonWallet.cpp:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33CocoonWallet::CocoonWallet(td::SecureString wallet_private_key, block::StdAddress wallet_owner, td::int64 low_balance,
34 BaseRunner *runner, std::shared_ptr<RunnerConfig> runner_config)
35 : TonScWrapper(block::StdAddress{}, {}, runner, std::move(runner_config)), low_balance_(low_balance) {
36 cocoon_wallet_private_key_ = std::make_unique<td::Ed25519::PrivateKey>(std::move(wallet_private_key));
37 auto pub = cocoon_wallet_private_key_->get_public_key().move_as_ok();
38 auto pub_key_str = pub.as_octet_string();
39 CHECK(pub_key_str.size() == 32);
40 cocoon_wallet_public_key_.as_slice().copy_from(pub_key_str.as_slice());
41 cocoon_wallet_owner_address_ = wallet_owner;
42
43 set_code(code_boc());
44 sc_update_address();
45}
46
47td::Ref<vm::Cell> CocoonWallet::code_boc() {
48 std::string boc = td::hex_decode(code_str()).move_as_ok();

Callers

nothing calls this directly

Calls 1

as_sliceMethod · 0.80

Tested by

no test coverage detected