Mint with Smart Contract
Simple Smart Contract - Time-locked minting with authorized signer
Objective
Implement a simple Aiken smart contract for minting tokens
Demonstrate the
mintpurpose validator in actionImplement time constraints with
validity_rangeRequire specific signers with
extra_signatories
Where to Find the Code
The complete example is available in the Simple Contract repository.
You can follow the README.md for setup instructions.
Smart Contract Overview
This example implements a minting policy with two validation conditions:
Time-lock: Minting is restricted to transactions before a predefined expiration timestamp
Authorized Signer: Only transactions signed by a specific key can mint tokens
The contract is written in Aiken and compiled to a Plutus script that produces a CIP-57 blueprint.
Implementation Example
Key Components for Minting Policy Transactions
When building a transaction to mint tokens with a time-locked policy, you need to include:
Mint Array: Defines what tokens to create with their metadata
Script Interactions: Provides the redeemer needed by the validator
Required Signers: Ensures the transaction is signed by the authorized key
Validity Interval: Sets the transaction time to comply with the time-lock
Complete Implementation
The following example demonstrates the full process of building, signing, and submitting a transaction that mints tokens with our time-locked policy:
Important Technical Details
Transaction Validation
The transaction will only succeed if the time-lock and signature conditions are met:
The transaction must be submitted before the contract's deadline timestamp. If the current time exceeds this deadline, validation will fail and the transaction will be rejected.
Signing the Transaction
This example requires a multi-signature transaction where both the customer wallet and the admin wallet must sign:
Last updated
Was this helpful?

