AmorStyle Distributed Sales Network NFTs

The next thing that I would like to introduce is a collection smart contracts that work together to handle settlement for a distributed sales network on the Theta blockchain. I’ve been calling it The AmorStyle Distributed Sales Network.

The idea is to incentivize more people to want to get involved in NFT projects. The incentive comes from NFT project creators providing a cut of the NFT mint. The NFT project creator offers that cut based on what they determine is reasonable for their project. The smart contract publishes that cut so that agents of the network can determine if talking about that project is worth the effort.

When a customer mints an NFT in the creator’s project, the smart contract carves up the mint funds as stated by the creator. Effectively, the NFT manages the cuts for the different agents and allows only that agent to claim the commissions.

As more creators learn that cool functionality can be enabled, or leveraged, using smart contracts, more of them will want to offer their services in an online fashion like this.

How does it all work?

First and foremost, this is a network of people that are all agreeing to work together in a semi-trustless way and the quality of what is offered is directly related to the amount of effort that different players offer to the network.

This network assumes there are Content Creators, Influencers, Technical people and Customers.

The Content Creators are the NFT projects. They offer up commissions to the agents and technical people to support their projects. They publish the minting cuts in order to incentivize the influencers to talk about their projects.

The Influencers are the Agents of the network. When you are a registered agent, any time someone mints using your Agent Id, you get the cut stated by the Content Creator. It’s handled by the smart contract.

The Technical people are those that provide websites and smart contract services for Content Creators. In order to talk to Smart Contracts, it needs to be handled by a website. And, because this is a network, would be better if multiple websites offer access to the content.

Can I see the code?

All the code for this project is currently published on this website. And, I’ve created the Gallery TestUI V1 project as a live demo.

Here are links to more info:

The Participant NFT

The Website NFT

The Agent NFT

The Gallery Project

Note that The Gallery is where I’m demonstrating this project. Please visit that link.

More Info

Even though this project is published and available for anyone to read or implement. I will be fielding questions in the TraderPunk discord. If you want to know the gritty details or get help as a Content Creator, please look me up.

Membership Demo newFunctionaliTee

Have you heard about Kalamazoo? If not, have I got a story for you!

For this demo project, I wrote a little JavaScript to go along with the two new NFTs that are now on the Theta blockchain.

And, even though the mint is unlimited, there will only be 42 winners awarded! It’s a first come, first served winning spree, so once you understand the concept, make sure you read how to win! (below at claim prize).

Kalamazoo

The main NFT is the Kalamazoo membership demo. This NFT simulates buying a club membership that costs a penny an hour. When a member signs up, there is a joining fee of $0.25 and the requirement that the purchaser funds at least 100 hours’ worth of membership time.

To do this, I wrote some ‘treasury’ code in the smart contract that allows the NFT owner to manage his Tfuel balance. Anyone can add Tfuel to an NFT, but only the owner of that NFT can withdraw the balance. At any time, anyone can query in order to determine how much tfuel balance is left. If there is a balance, the membership is considered active. If funds backing the token run dry, the owner of the NFT (or anyone else) can reactivate the NFT by placing funds on that account.

The fee associated with minting, reactivation and membership is credited to “The Titled” person (or account). The contract has the idea that there is a project owner and an IT owner. The project owner is considered the property owner, thus is credited the funds associated with the project. The IT owner is allowed to operate admin functionality in the smart contract on behalf of the property owner but can’t claim any funds.

Said differently, funds are managed by token Id. If you put 50 Tfuel on your token that will be used to pay your membership balance over time. But, if you transfer your token to someone else, they will now have ownership of that Tfuel balance which effectively gives them the hours that you just bought. In a way, the Token now has intrinsic value based on the number of hours of membership time it can buy.

Penny Oracle V1

I also created a contract that can be used to provide the current cost of a penny’s worth of Tfuel. The Kalamazoo contract uses the Penny Oracle V1 in order to determine the dollar price for membership.

This means that the value in the treasury buys more or less time as the price of Tfuel fluctuates. If tfuel goes to a dollar, the Kalamazoo membership will only charge a penny’s worth of tfuel per hour.

(* There is also a concept of claiming which cements the running calculations. If you want to learn the details, find me in the TraderPunks discord.)

Summary

If I were to spin this contract up again, there are some things that I would do differently. The most obvious thing is to write fewer functions in the smart contract.

Why? Well, Solidity and JavaScript allow for returning multiple values on a call. When loading a page for a website, each call adds to the load time. Thus, rather then call a bunch of small routines to get the ‘status’ of the NFT, it makes more sense to call a getStatus() type routine that returns everything at once.

So, how to you take a closer look?

Kalamazoo Membership

The best way to get involved is to visit the minting page:

Mint Page Here

Oh, and read the whitepaper.

Also, this is a demo, so cut it some slack. The best thing you can do is copy the project and put out something better. If not, help me make it better. 

Claim Prize

To win the prize, you have to follow a specific set of steps in order to be allowed to claim a winning position. These steps are designed to show you how to mint, withdraw your balance, reactivate and monitor your remaining hours.

Basically, when there are 15 hours left on your membership balance, the Claim Prize button will activate on the minting page. If there is still a position open, you will be assigned that position and the token will enter the winner’s circle.

The easiest way to get there is to mint, withdraw your balance and then reactivate with enough Tfuel to cover the $0.10 reactivation fee and another $0.15 to enable 15 hours’ worth of membership time. If you get that correct, the minting page will enable the Claim Prize button and you can ‘win’ if you want.

SendLock newFunctionaliTee

Mint Link Below

Mint

As NFTs evolve to provide more services, the loss of that resource (or what that NFT grants access too) could cause significant emotional or even financial hardship.

This next Theta blockchain based NFT introduces a modification to the standard transfer design in 721 contracts that can be employed by NFT creators that will help protect the NFT resource in the case of the account being hacked.

When websites offer functionality that requires a ‘hot’ wallet (one that is always connected, or wallets where the user remains logged in for extended periods of time (like Metamask)) it opens up situations where family members or co-workers could find ways to access your resources.

Or, regardless of the wallet state, if someone else gets a copy of your private keys, they have complete access to your resources. If multiple people hold the same private keys, both people have full access to the resources of that wallet. If one is a hacker, chances are high you will lose everything you store in that wallet.

To help mitigate the damage done by less secure crypto wallets (and environments), the SendLock newFunctionaliTee contract allows the resource owner to register (or cash) the next transfer operation for the NFT before any damage can be done by a hacker.

The idea is like this:

  • Mint the NFT
  • Put the NFT in the wallet where you’ll use it
  • Perform a sendLockRegister() call giving it your backup wallet

Now, the next time a send operation is executed on this NFT, the contract will move it to the cashed location – NOT the requested location. And, once it’s been set, it can’t be unset. Thus, the hacker will not be able to override this functionality.

I encourage you to give it a try with this sample NFT. It cost 5 tfuel to mint, 3 tfuel to ‘flip’ the coin and 1 tfuel to register the SendLock wallet.

Here are some links to the SendLock NFT.

Contract Address: 0x738acc1ecf2339079c54a8bf8fc47aa3535bb65f

Minting Page

Whitepaper

Metadata Hash – newFunctionaliTee

Tada!

In celebration of my ’24 New Years goals, I’ve launched my first ‘official’ New Functionali-Tee smart contract on the Theta blockchain. I’m calling it the Metadata Hash NFT which shows a technique by which an NFT project author can demonstrate file authenticity while using a private server.
Mint Here!

Why?

Well, I’ve put some thought into the whole InterPlanetary File System (IPFS) idea and it doesn’t really make sense to store somethings forever. Imagine if the concert you went to in ’84 was an NFT and the ticket was an NFT that was issued and redeemed within a couple months. Would it make sense to have that digital garbage still hanging around 40 years later? Probably not. Seems like a waste of global resources.

But, if you were the chairman of the band’s fanclub you would probably want to save all that original data. If you do, the cost of ownership is local and most likely manageable.

The complication comes when proving you hold the original data.

Blockchains help with this. If you hash a file and then store that hash on the blockchain, it doesn’t matter who owns the file or where it is stored, if you have the original file you can prove it by generating the original hash.

This project takes advantage of this functionality by hashing all the files used to build this NFT and writing those hashes into a project file which is intern hashed. That final hash is stored on the blockchain.

If someone gets a copy of the root file (which holds all the hashes) they can prove that they have an original by hashing it. If the hash matches the blockchain value the file is unaltered. Then, all the hashes stored within that project file can be used to validate that all the other files (images, whitepaper, etc) are also unaltered.

This allows a level of verification that allows project creators to change servers and still prove they have the original files. This might allow an artist to sell his creation to a different company and that new owner can serve the project in a verifiable way.

In the end, the public cost is a hash on the blockchain.

The NewFunctionaliTee

Contract: 0x3af8d9df292ba083fb37d71df813f6d5ab0ad450

Whitepaper: https://amorstyle.com/nfts/metadatahash/whitepaper.pdf

Project: https://amorstyle.com/nfts/metadatahash/metadatahash.json

And, if you’d like to mint one of these NFTs, click HERE!

Example Sending coin via MetaMask

Here is an example of how to use Metamask to send some coin on the Theta network.

ChainId:
From:
BlockHeight:
Balance:

Amount of tfuel:
To:

Status:

Here is a downloadable ZIP file that contains the WordPress plugin code that integrates with Metamask.

This plugin installs just like any other WordPress plugin.

When you review the code, you’ll find a csendtobutton.js file that contains the class that handles the above shortcode.

Note that this is the next version of my tweb3mmexplore plugin. All the old functionality should continue to work as should this new ‘send’ functionality.

WP Plugin to Connect to MetaMask

As you might have noticed, this website now has the ability to connect to MetaMask. That functionality is implemented within a WordPress plugin that I provide the download link to below.

At this point, the plugin demonstrates two different functionalities.

  • The ability to dynamically connect to MetaMask, and
  • How to Sign a transaction.

The connect functionality is demonstrated via the button on the top right part of the website. Feel free to give that a try.

The Signing functionality is demonstrated here:

Sign Typed Data V4

Note that the phrase “Describe what’s being signed here” and the secret is placed in the page HTML by the server, thus it can be custom designed.

Why MetaMask?

MetaMask is a 3rd party crypto wallet application that empowers the users of a smart contract based blockchain to interact with websites in new and unique ways. Users create accounts in MetaMask and then link in MetaMask friendly websites. The linked website as the ability to ask for information from the wallet to allow interactions on the blockchain without the website needing to know anything about the user’s private keys.

When a website is ‘connected’ to MetaMask, the user is effectively ‘white listing’ the website with regards to it’s public address and balance.

When a connected website asks for something to be signed, the website calls MetaMask with the information to be signed and awaits the signature. Signatures can only be generated by wallets for it requires the knowledge of private keys. Thus, the website can get proof that you are the owner of a public address by asking for a signature.

Please note that it’s good practice to keep little or no crypto in the MetaMask wallet that you connect to random websites. Yes, any interaction that occurs from the website to MetaMask will require your response to complete, but common sense would say to reduce your risks by only keeping what is needed on that wallet.

About the Code

As with the other plugins that I create and share, this one is built off a template generated from https://wppb.me/. If you generate your own copy using my tag strings, you’ll be able to see the lines/files of code that I added.

One thing that I would really like to point out is that when I went looking for samples that would provide the ‘connect’ functionality, the sample plugins typically included dozens of additional add-in files or libraries that seemed overly complex to me. My coding philosophy is, if you don’t intellectually understand the code, you’re dependent upon some other person to make forward progress. Thus, I’ve made it a point to reduce the sample down to what is functionally needed.

A word of caution here, this is my first JavaScript code example. In the process of trying to figure out how to debug and use the MetaMask sample code, I ended up reading through the JavaScript manual online in order to get the higher-level understandings upon which I built upon.

Out of this, one of the more important features empowered by coders is the ability to use libraries or incorporate classes that have been created from other projects. Thus here, you’ll see I import code from ‘modules’.

The Plugin

Here is a downloadable link to the WordPress plugin.

Please read through the code before using to make sure you understand what’s going on. If you have feedback, please let me know.