Skip to content

Instantly share code, notes, and snippets.

@ToJen
ToJen / LoadTestnetAccountsOnMetaMask.md
Created November 15, 2017 21:33
How to view Truffle/TestRPC accounts on MetaMask

If you want to access the accounts on MetaMask, you will need to do the following:

  • Log out of MetaMask: click on the hamburger menu and select Lock
  • Select Restore from seed phrase
  • Paste the mnemonic that was created when you ran truffle develop
  • Create a new password and confirm

Source: How can I import the accounts from truffle develop into MetaMask?

@ToJen
ToJen / Escrow-Smart-Contract
Last active September 27, 2021 12:38 — forked from bitgord/Escrow-Smart-Contract
Example of an escrow smart contract
// package.json
{
"dependencies": {
"web3": "0.20.0",
"solc": "^0.4.19"
}
}
//Create file Ecrow.sol and create 3 variables: a buyer, a seller, and an arbiter
contract Escrow {
function mapToJson(map) {
return JSON.stringify([...map]);
}
function jsonToMap(jsonStr) {
return new Map(JSON.parse(jsonStr));
}
// map to JSON
@ToJen
ToJen / Bakery.sol
Last active August 31, 2018 13:20
Example factory contract
pragma solidity ^0.4.9;
contract Cookie {
bool public hasChocolate;
function Cookie(bool _hasChocolate) public {
hasChocolate = _hasChocolate;
}
package main
import (
"fmt"
"io"
"os"
"time"
"context"
@ToJen
ToJen / collapse.md
Last active September 23, 2020 13:49
@ToJen
ToJen / BaseForm.tsx
Last active March 26, 2024 20:56 — forked from ShinyObjectLabs/BaseForm.tsx
Framer Form Component
/*
MIT License
Copyright © Joel Whitaker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: