ποΈTON smart contract for NFT raffle
import { Address, serializeDict, Cell } from "ton";
const messageBody = new Cell();
messageBody.bits.writeUint(2, 32); // op
messageBody.bits.writeBit(true)
const ticketsCell = serializeDict(
new Map<string, Address>(tickets.map((v, k) => [k.toString(), v])),
32,
(value, cell) => cell.bits.writeAddress(value)
)
messageBody.refs.push(ticketsCell)
messageBody.bits.writeUint(tickets.length, 32)import { Address, serializeDict, Cell } from "ton";
const messageBody = new Cell();
messageBody.bits.writeUint(1, 32); // op
messageBody.bits.writeBit(true)
const nftsCell = serializeDict(
new Map<string, Address>(nfts.map((v, k) => [k.toString(), v])),
32,
(value, cell) => cell.bits.writeAddress(value)
)
messageBody.refs.push(nftsCell)Last updated