z3eGqbqy3Coz6XSCAT4HLHf4mDVs8/contract.lua
npub1smarczws3grrrm3vgd3t6tx6vw25xn48jdqv7xrujnf5c5ghh7ps5yj78s 9e8b692d0c
genesis
2024-05-24 10:52:44 +02:00

21 lines
477 B
Lua

function __init__ ()
return {hue=0}
end
function sethue ()
if call.msatoshi < 1000000 then
error('pay at least 1000 sats!')
end
if type(call.payload.hue) ~= 'number' then
error('hue is not a number!')
end
if call.payload.hue < 0 or call.payload.hue > 360 then
error('hue is out of the 0~360 range!')
end
contract.state.hue = call.payload.hue
contract.send('86fa35962e3c40d400f983422284ce5470fb7c3900deb0606d1e2be8ba0f5d9a', call.msatoshi)
end