pub enum ContractAction {
Deploy {
code: Vec<u8>,
gas_limit: u64,
},
Call {
contract: Hash32,
input: Vec<u8>,
value: u64,
gas_limit: u64,
},
PoolCreate {
token: Hash32,
block_amt: u64,
token_amt: u64,
gas_limit: u64,
},
PoolAdd {
token: Hash32,
block_amt: u64,
token_max: u64,
gas_limit: u64,
},
PoolRemove {
token: Hash32,
shares: u64,
gas_limit: u64,
},
PoolSwapBuy {
token: Hash32,
block_in: u64,
min_token_out: u64,
gas_limit: u64,
},
PoolSwapSell {
token: Hash32,
token_in: u64,
min_block_out: u64,
gas_limit: u64,
},
LaunchToken {
code: Vec<u8>,
block_amt: u64,
token_amt: u64,
gas_limit: u64,
},
LaunchNft {
code: Vec<u8>,
gas_limit: u64,
},
Intel(IntelAction),
}Variants§
Deploy
Store code as a new contract. The contract id is derived from the
deploying txid.
Call
Execute a deployed contract. value moves from this transaction’s
inputs into the contract’s balance before execution (refunded to the
sender if the call fails).
PoolCreate
Native AMM — create a BLOCK/token pool seeded with block_amt BLOCK
(from inputs) and token_amt of the BLOCK-20 token (from the sender’s
token balance). LP shares lock for one week.
PoolAdd
Add liquidity at the current ratio: block_amt BLOCK plus up to
token_max of the token. Re-locks the position for one week.
PoolRemove
Withdraw shares of LP (BLOCK paid out, token credited). Fails if the
position is still within its one-week lock.
PoolSwapBuy
Swap block_in BLOCK (from inputs) for the token; reverts (refund) if
the output would be below min_token_out.
PoolSwapSell
Swap token_in of the token for BLOCK (paid out); no-op if the output
would be below min_block_out.
LaunchToken
Atomic token launch — deploy code, run its init() (minting the baked
supply to the sender), and seed a BLOCK/token AMM pool with block_amt
BLOCK (from inputs) and token_amt of the freshly minted supply, all in
ONE transaction (one block). Removes the deploy→init→pool race entirely:
the pool can’t fire before the mint exists. If any step fails the whole
action reverts and block_amt is refunded to the sender.
LaunchNft
Atomic NFT-collection launch — deploy code (a BLOCK-721 collection) and
run its init() (selector 0, which fixes the deployer as the minter) in
ONE transaction. Removes the deploy→init race for collections; subsequent
mints are independent single calls once this confirms.
Intel(IntelAction)
Blockle Intelligence action (height-gated; see IntelAction).