Skip to content

Instantly share code, notes, and snippets.

View tempe-techie's full-sized avatar
🤘
Rock on!

Tempe Techie tempe-techie

🤘
Rock on!
View GitHub Profile
@tempe-techie
tempe-techie / degen-names-quickstart.md
Last active May 3, 2024 05:59
.degen names integration

How to integrate .degen names

.degen smart contract: 0x4087fb91A1fBdef05761C02714335D232a2Bf3a1

There are only two functions in the .degen smart contract important for integrations:

  • Resolver: getDomainHolder(name) (note: enter only name without extension, e.g.: tempe, not tempe.degen)
  • Reverse resolver: defaultNames(address)

Resolver (getDomainHolder): get user's address

@tempe-techie
tempe-techie / iggy.md
Last active December 6, 2023 09:43
Introduction to Iggy Social

Iggy - Web3 Social for DAOs and online communities

Iggy is a free and open-source Web3 Social framework. It helps DAOs and other Web3 communities quickly build their own Web3 Social sites.

Think of it as the "Wordpress" for Web3 Social.

With Iggy, setting up a Web3 Social site for your community becomes a breeze. All content, such as posts and replies, is stored on decentralized storage (Ceramic/IPFS).

You have complete control; there's no corporation behind (like Facebook or Twitter) that could deplatform your community or censor it. It's a truly community-owned chat, where the community can establish its rules and vote for its moderators.

@tempe-techie
tempe-techie / efp-ideas.md
Created April 21, 2023 15:04
Ethereum Follow Protocol ideas

Brainstorming EFP implementation ideas (WIP)

The original idea: https://twitter.com/BrantlyMillegan/status/1648794925754974209

  • Lists of accounts being followed
  • Each list is an NFT (ERC-721) and is transferable

The code below should be considered as pseudocode as it wasn't compiled or tested, just written off the top of my head.

Non-NFT example

@tempe-techie
tempe-techie / Redirect.sol
Last active November 5, 2022 11:41
Redirect contract (quick prototype, untested)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/interfaces/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract Redirect is Ownable {
address public receiver;
@tempe-techie
tempe-techie / hardhatEtherscan.js
Last active July 6, 2022 15:54
Hardhat Verify API key names
module.exports = {
networks: {
mainnet: { ... },
testnet: { ... }
},
etherscan: {
apiKey: {
mainnet: "YOUR_ETHERSCAN_API_KEY",
ropsten: "YOUR_ETHERSCAN_API_KEY",
rinkeby: "YOUR_ETHERSCAN_API_KEY",
@tempe-techie
tempe-techie / helpers.sol
Created June 30, 2022 15:49
Solidity helpers
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.6;
contract Helpers {
// slice string
function getSlice(uint256 begin, uint256 end, string memory text) internal pure returns (string memory) {
bytes memory a = new bytes(end-begin+1);
for(uint i=0;i<=end-begin;i++){
a[i] = bytes(text)[i+begin-1];
}
@tempe-techie
tempe-techie / BytesParsing.sol
Last active June 30, 2022 13:02
Parsing bytes in Solidity (hex strings like color codes, and numbers)
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.5 <0.9.0;
contract BytesParsing {
// example bytes calldata: 0x3A1174741911F257FFCA965A00000002010000
// color codes: #3a1174, #741911, #f257ff, #ca965a, #000000
// numbers: 2, 1, 0, 0
function uint8tohexchar(uint8 i) internal pure returns (uint8) {