9 #include <tvm/schema/message.hpp>
10 #include <tvm/smart_switcher.hpp>
11 #include <tvm/contract_handle.hpp>
12 #include <tvm/replay_attack_protection/timestamp.hpp>
16 static constexpr
unsigned USERID_TIMESTAMP_DELAY = 1800;
17 using userid_replay_protection_t = replay_attack_protection::timestamp<USERID_TIMESTAMP_DELAY>;
38 uint128 evers_to_auth_idx,
39 uint128 refill_wallet,
46 uint256 new_lend_pubkey,
47 uint128 evers_to_remove,
48 uint128 evers_to_auth_idx
57 [[
internal, answer_id]]
73 uint128 refill_wallet,
81 using IUserIdIndexPtr = handle<IUserIdIndex>;
103 static std::pair<StateInit, uint256> execute(
DUserIdIndex data, cell code) {
104 auto init_hdr = persistent_data_header<IUserIdIndex, userid_replay_protection_t>::init();
105 cell data_cl = prepare_persistent_data<IUserIdIndex, userid_replay_protection_t>(init_hdr, data);
106 StateInit init { {}, {}, code, data_cl, {} };
107 cell init_cl = build(init).make_cell();
108 return { init, uint256(tvm_hash(init_cl)) };
UserIdIndex persistent data struct.
Definition: UserIdIndex.hpp:84
uint128 refill_wallet_
Re-fill wallet on transfer received.
Definition: UserIdIndex.hpp:90
uint256 user_id_
User id, it is used for address calculation.
Definition: UserIdIndex.hpp:86
uint256 lend_pubkey_
Definition: UserIdIndex.hpp:87
uint128 min_refill_
Minimum refill value.
Definition: UserIdIndex.hpp:91
opt< string > name_
Encrypted login. We use naclbox for encryption.
Definition: UserIdIndex.hpp:89
UserIdIndex events interface.
Definition: UserIdIndex.hpp:96
UserIdIndex contract interface. There is no way to understand which wallets were created for some Fle...
Definition: UserIdIndex.hpp:31
UserIdIndexSalt getConfig()
Get config from code salt.
void onDeploy(uint256 lend_pubkey, string name, uint128 evers_to_auth_idx, uint128 refill_wallet, uint128 min_refill)
Check that msg.sender is an owner (from configuration salt). Deploy AuthIndex with lend_pubkey.
uint256 requestLendPubkey(uint128 evers_balance)
Request lend pubkey (current app pubkey).
void transfer(address dest, uint128 value, bool bounce)
Transfer evers.
void reLendPubkey(uint256 new_lend_pubkey, uint128 evers_to_remove, uint128 evers_to_auth_idx)
Remove AuthIndex with lend_pubkey. Deploy AuthIndex with new_lend_pubkey. Set lend_pubkey = new_lend_...
void setRefillWallet(uint128 refill_wallet, uint128 min_refill)
Set re-fill wallet value.
UserIdIndex configuration data (code salt)
Definition: UserIdIndex.hpp:20
cell auth_index_code
Code of AuthIndex (no salt)
Definition: UserIdIndex.hpp:22
address owner
Address that can send command messages to UserIdIndex. It is address of FlexClient.
Definition: UserIdIndex.hpp:21