Loading...
dAppFather will refill accounts to the certain amount for Users performing actions on Devices owned by Suppliers. This dApp is managed directly by Skey Network. To allow refilling, Suppliers and Organisations have to be added to the dAppFather.
Functions are listed bellow:
refill_amount
number
required
Amount to refill in Skeylets
supplier_<address>
string
“active”
Supplier allowed to refill
org_<address>
Organisation allowed to refill
Refills target account if main asset is under specified amount.
targetAddrStr - address of target
targetAddrStr
caller is written as Supplier or Organisation in data
func refill(targetAddrStr:String) = { let callerStrAddr = toBase58String(i.caller.bytes) let targetAddr = addressFromStringValue(targetAddrStr) let refillAmount = getRefillAmount() let refill = shouldRefill(targetAddr, refillAmount) if(activeAsSupplier(callerStrAddr)||activeAsOrg(callerStrAddr)) then { if(!refill)then { ([],false) }else{ # if user asset balance is below specified level ([ ScriptTransfer(targetAddr,refillAmount, unit) ],true) } } else ([],false) }