-- SPDX-FileCopyrightText: 2021 Oxhead Alpha -- SPDX-License-Identifier: LicenseRef-MIT-OA module TestSuite.Cleveland.Lorentz.Contracts.ContractAllocator ( allocatorContract ) where import Lorentz as L import Test.Cleveland.Instances () allocatorContract :: Contract [Address] Storage () allocatorContract = mkContract allocatorContractLorentz type Storage = ("storage" :! [Address]) allocatorContractLorentz :: ContractCode [Address] Storage allocatorContractLorentz = mkContractCode $ unpair # dip (nil @Operation) # iter ( unsafeContractCalling @() DefEpName # whenSome (push 1 # unit # transferTokens # cons) ) # unit # push 0 # none @KeyHash # createContract @() @() (defaultContract failWith) # dip L.drop # cons # pair