This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function burnNFT(nftID) | |
local mintTime = getNFTMintTime(nftID) | |
local currentTime = os.time() | |
local secondsInDay = 60 * 60 * 24 | |
local secondsToBurn = secondsInDay * 31 | |
if (currentTime - mintTime >= secondsToBurn) then | |
burnNFTByID(nftID) | |
return "NFT " .. nftID .. " burned" | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Smart contract to burn an NFT after 12 months from the minted date | |
function constructor() | |
state.var { | |
nft = state.nft('nft'), | |
owner = state.address('owner'), | |
minted_date = state.value(), | |
burn_date = state.value() | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Contract for creating a fungible token on MoltenChain | |
contract = function() | |
-- Token details | |
local name = "My Token" | |
local symbol = "MTK" | |
local website = "www.mytoken.com" | |
local image_url = "https://www.mytoken.com/logo.png" | |
local description = "This is my token for testing purposes." | |
local total_supply = 100000000 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local molten_chain = require("molten_chain") | |
local magma_token = molten_chain.new_token("MAGMA") | |
local token = molten_chain.new_token("TOKEN") | |
function deploy_liquidity_pool() | |
-- Check if MAGMA and TOKEN are valid tokens | |
if not magma_token:is_valid() or not token:is_valid() then | |
error("Invalid token") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Non-fungible token mint smart contract | |
-- constants | |
local tokenName = "Non-fungible Token" | |
local tokenDescription = "Non-fungible Token is a unique digital asset on the blockchain. It can be used for various purposes such as digital collectibles, gaming, and more." | |
-- state variables | |
local tokenURI = {} | |
local tokenOwners = {} | |
local tokenMetadata = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Fungible Token Farming Smart Contract for MoltenChain | |
-- Define the name and symbol of the fungible token | |
local tokenName = "Your Token" | |
local tokenSymbol = "YURT" | |
-- Define the total supply of the fungible token | |
local totalSupply = 100000000 | |
-- Define the farming rate, in this case, 1 token per block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Define the function to deploy the side-chain | |
function deploy_side_chain(chain_name, token_ticker) | |
-- Create the side-chain and set the name and token ticker | |
local side_chain = Chain:new(chain_name, token_ticker) | |
-- Add the side-chain to the list of side-chains | |
side_chains[chain_name] = side_chain | |
-- Return the side-chain for further use | |
return side_chain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- define the contract function | |
function swapTokens(tokenId1, amount1, tokenId2, amount2) | |
-- get the tokens from the blockchain | |
local token1 = blockchain.getToken(tokenId1) | |
local token2 = blockchain.getToken(tokenId2) | |
-- check that the caller owns the specified amount of token 1 | |
if token1.amount < amount1 then | |
error("The caller does not own enough of token 1") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Define the contract | |
local contract = { | |
init = function(self) | |
-- Initialize variables | |
self.timeLocked = {} | |
self.lockedAmounts = {} | |
end, | |
-- Method to lock up liquidity | |
lock = function(self, sender, amount, lockTime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am floatbeta on github. | |
* I am magm (https://keybase.io/magm) on keybase. | |
* I have a public key ASAIE1BQL9FbowHaiII1iBMo8-tUgFjWu_NwxyvXJMyl5go | |
To claim this, I am signing this object: |