Skip to content

Instantly share code, notes, and snippets.

@danicuki
danicuki / macros.gs
Created November 28, 2022 14:11
Get All Transactions from Gnosis to Google Sheets
async function GetStatements() {
var spreadsheet = SpreadsheetApp.getActive();
var s = spreadsheet.getSheetByName("Vault Payments")
s.getRange(1, 1).setValue("Nonce")
s.getRange(1, 2).setValue("submissionDate")
s.getRange(1, 3).setValue("To")
s.getRange(1, 4).setValue("value")
s.getRange(1, 5).setValue("transactionHash")
s.getRange(1, 6).setValue("Wallet")
@danicuki
danicuki / App.jsx
Created July 26, 2022 12:16
JS DAO App.jsx
import { useAddress, useMetamask, useEditionDrop, useToken, useVote } from '@thirdweb-dev/react'
import { useState, useEffect, useMemo } from 'react'
import { AddressZero } from "@ethersproject/constants";
const App = () => {
// Use o hook connectWallet que o thirdweb nos dá.
const address = useAddress()
const connectWithMetamask = useMetamask()
console.log("👋 Address:", address)
@danicuki
danicuki / Main.hs
Created July 12, 2022 16:43
Homework - 2 givers - 1 receiver - haskell
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended.V1
main :: IO ()
main = printJSON $ contract
{- Define a contract, Close is the simplest contract which just ends the contract straight away
@danicuki
danicuki / Main.hs
Created July 12, 2022 15:54
Homework - 2 givers - 1 receiver - haskell
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended.V1
main :: IO ()
main = printJSON $ contract
{- Define a contract, Close is the simplest contract which just ends the contract straight away
@danicuki
danicuki / metadata.json
Last active July 12, 2022 15:49
Homework - 2 givers - 1 receiver
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,""],"tag":"DecimalFormat"},"valueParameterDescription":"Amount Deposited"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@danicuki
danicuki / metadata.json
Created July 11, 2022 20:13
PayToContractSample
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@danicuki
danicuki / EpicNFT.sol
Created June 27, 2022 02:09
NFT with random colors
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "hardhat/console.sol";
import { Base64 } from "./libraries/Base64.sol";
@danicuki
danicuki / App.js
Last active July 1, 2022 13:48
NFT Collection - final
import React, { useEffect, useState } from "react"
import "./styles/App.css"
import twitterLogo from "./assets/twitter-logo.svg"
import { ethers } from "ethers"
import myEpicNft from "./utils/MyEpicNFT.json"
// Constants
const TWITTER_HANDLE = "web3dev_"
const TWITTER_LINK = `https://twitter.com/${TWITTER_HANDLE}`
const OPENSEA_LINK = ""
@danicuki
danicuki / MyEpicNFT.sol
Created June 20, 2022 01:38
MyEpicNFT.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.1;
// Precisamos de algumas funcoes utilitarias.
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "hardhat/console.sol";
// Precisamos importar essa funcao de base64 que acabamos de criar
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
/// [MIT License]
/// @title Base64