Raiders Contracts
Raiders Contracts will allow anyone to create bounties for community members to earn
rewards for taking specific actions.
Validator Descriptions
There are a few validators we will be using:
- raid_mint - This is the minting policy for
RaidNFT
- raid_lock - This locks
RaidNFT
with their bounty - parameter_mint - This is the minting policy for
ParameterNFT
- parameter_lock: This locks
ParameterNFT
with its datum
Raid Datum
type RaidDatum {
quantity: Int,
price: Int,
creator: VerificationKeyHash,
}
Parameter
pub type Parameter {
raid_locker_script_hash: ScriptHash,
}
How to use off-chain?
Parameter Functions
import { parameterBurn, parameterMint } from "raiders-validator";
Mint Parameter
const txCompleteResult = await parameterMint(lucid, adminAddress);
if (!txCompleteResult.ok) {
console.error(txCompleteResult.error);
} else {
const txHash = await(await txCompleteResult.data.sign().complete()).submit();
}
Burn Parameter
const txCompleteResult = await parameterBurn(lucid, adminAddress, unit);
if (!txCompleteResult.ok) {
console.error(txCompleteResult.error);
} else {
const txHash = await(await txCompleteResult.data.sign().complete()).submit();
}
Raid Functions
import {
raidClaim,
raidCreate,
raidRemove,
raidUpdate,
} from "raiders-validator";
Create a Raid
const txCompleteResult = await raidCreate(
lucid,
quantity,
price,
creator,
parameterRefUtxoTxHash,
parameterRefUtxoTxIndex
);
Claim from a Raid
const txCompleteResult = await raidClaim(
lucid,
adminAddress,
unit,
userAddress,
parameterRefUtxoTxHash,
parameterRefUtxoTxIndex
);
Update a Raid
const txCompleteResult = await raidUpdate(
lucid,
unit,
newQuantity,
userAddress,
parameterRefUtxoTxHash,
parameterRefUtxoTxIndex
);
Remove a Raid
const txCompleteResult = await raidRemove(
lucid,
unit,
userAddress,
parameterRefUtxoTxHash,
parameterRefUtxoTxIndex
);