13 lines
301 B
Plaintext
13 lines
301 B
Plaintext
contract TestContract =
|
|
record state = {
|
|
_allowed : map(address, map(address, int))}
|
|
|
|
public stateful function init() = {
|
|
_allowed = {}}
|
|
|
|
public stateful function approve(spender: address, value: int) : bool =
|
|
|
|
put(state{_allowed[Call.caller][spender] = value})
|
|
|
|
true
|