HODLERS Documentation
HomeRelease with us
  • About HODLERS
  • FAQ
  • Type of Projects
    • Fully on-chain projects
    • Pre-rendered projects
    • 1 of 1s
    • Standard Editions
  • Type of collection
    • Genesis Exhibition
    • The Vault by Hodlers
  • Info
    • Smart Contracts
    • APIs
  • 🖇️Links
    • Twitter
    • Discord
    • Subscribe to our releases (Google)
    • Subscribe to our releases (iCal)
Powered by GitBook
On this page
  • Sales Mechanic
  • Examples

Was this helpful?

  1. Type of Projects

Pre-rendered projects

PreviousFully on-chain projectsNext1 of 1s

Last updated 1 year ago

Was this helpful?

Our smart contract is deployed and created by Art Blocks, we are currently using their V3 Flex contract.

Sales Mechanic

Fixed Price Discount Minter

Our platform offers a Fixed Price Discount Minter that allows customizable discounts for members. By default, Genesis Exhibition holders receive a 65% discount, while Isotopias holders receive a 30% discount on their purchases.

For Setup Guide on Goerli & Mainnet please feel free to contact our team.

We are actively working to add more minters to our platform, expanding the creative possibilities for artists.

Examples

Example script for Engine Flex

function fisherYatesShuffle(seed, array) {
let currentIndex = array.length;
let temporaryValue, randomIndex;

while (currentIndex !== 0) {
randomIndex = (seed + currentIndex) % currentIndex;
currentIndex -= 1;

temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}

return array;
}

function generateIndices(seed, totalImages) {
const array = Array.from({ length: totalImages }, (_, i) => i + 1);
return fisherYatesShuffle(seed, array);
}

function selectImage(tokenId, totalImages = 100) {
const seed = {xxxxxxxxx};
const indices = generateIndices(seed, totalImages);
console.log(`tokenId: ${tokenId}`)
console.log(`Selection: ${indices[tokenId % totalImages]}`)
return indices[tokenId % totalImages];
}


const selectedImage = selectImage(tokenData.tokenId);

let img;

function preload() {
img = loadImage(` {HODLERS Dedicated Pinata Gateway}/${selectedImage}.png or .jpg`);
}

function setup() {
createCanvas(windowWidth, windowHeight);
}

function draw() {
background(255 or 0);

let imgAspectRatio = img.width / img.height;

let newWidth = width;
let newHeight = newWidth / imgAspectRatio;

if (newHeight > height) {
newHeight = height;
newWidth = newHeight * imgAspectRatio;
}

let x = (width - newWidth) / 2;
let y = (height - newHeight) / 2;

image(img, x, y, newWidth, newHeight);
}

function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
Whispers of Knowledge by Ferdinand Dervieux
Page cover image