Skip to content

Instantly share code, notes, and snippets.

View t8's full-sized avatar
🎯
Focusing

Tate Berenbaum t8

🎯
Focusing
View GitHub Profile
@t8
t8 / NFT.js
Last active April 28, 2022 03:18 — forked from samcamwilliams/Physical-Asset-NFT.js
A Verto-compatible SmartWeave contract for NFTs.
export function handle (state, action) {
let owner = state.owner
const input = action.input
const caller = action.caller
const contact = action.contact
if (input.function === 'transfer') {
const target = input.target
if (!target || (caller === target)) {
@t8
t8 / pst.uwu
Created February 4, 2021 17:01
A Profit-Sharing Token Contract built using uwu.
fn handle(state, action):
let input = action["input"]
let caller = action["caller"]
if (input["function"] == "transfer"):
let target = input.target
let quantity = input.quantity
let balances = state.balances
if (!target):
return 0
@t8
t8 / swContractInvocation.js
Created January 12, 2021 05:52
Test PST contract that supports the Foreign Call Protocol
export async function handle (state, action) {
const owner = state.owner;
const balances = state.balances;
const invocations = state.invocations;
const input = action.input;
const caller = action.caller;
if (input.function == "transfer") {
const target = input.target;
const qty = input.qty;
@t8
t8 / siteDeploymentSWContract.js
Last active January 11, 2021 05:22
A SmartWeave contract for deploying dynamic permaweb apps.
export function handle(state, action) {
const authors = state.authors;
const deployments = state.deployments;
const input = action.input;
const caller = action.caller;
if (input.function === "deploy") {
const deployment = input.deployment;
if (!authors.includes(caller)) {
throw new ContractError(`${caller} is not an author and cannot deploy`);
@t8
t8 / keybase.md
Created September 24, 2020 02:00

Keybase proof

I hereby claim:

  • I am t8 on github.
  • I am tbaumer2 (https://keybase.io/tbaumer2) on keybase.
  • I have a public key ASA-Eaoa6_knp7gcf88yhMJ8ElD1mpoA-EnjhzjeN99egwo

To claim this, I am signing this object: