Skip to content

Instantly share code, notes, and snippets.

View thurendous's full-sized avatar
:shipit:
Citizen of World

MW thurendous

:shipit:
Citizen of World
View GitHub Profile
@thurendous
thurendous / ContractInBytecode.sol
Created August 27, 2023 01:50
try to create a contract in byte code
// MIT
pragma solidity ^0.8.13;
// Runtime code
// Creation code
// Factory code
contract Factory {
@thurendous
thurendous / pythonCheckFunctionSelector.py
Created August 26, 2023 06:32
This is a script to check if there are function selector's collision.
from web3 import Web3
import os
import hashlib
# Function to extract signatures
def extract_function_signatures(src):
lines = src.split("\n")
function_lines = [
line.strip() for line in lines if line.strip().startswith("function")
@thurendous
thurendous / DecentralizedStablecoin.sol
Created July 18, 2023 00:47
This is an example of how to create a stablecoin in solidity. There is some useful comments in the beginning of the code also.
// SPDX-License-Identifier: MIT
// This is considered an Exogenous, Decentralized, Anchored (pegged), Crypto Collateralized low volitility coin
// Layout of Contract:
// version
// imports
// errors
// interfaces, libraries, contracts
// Type declarations
@thurendous
thurendous / AboutEncoding.sol
Last active July 10, 2023 14:47
About encodings in solidity and talking about how they work.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
// For the cheatsheet, check out the docs: https://docs.soliditylang.org/en/v0.8.13/cheatsheet.html?highlight=encodewithsignature
contract Encoding {
function combineStrings() public pure returns (string memory) {
return string(abi.encodePacked("Hi Mom! ", "Miss you."));
}
@thurendous
thurendous / create2.sol
Created February 14, 2023 02:00
Deploy and predict the address using create2
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;
//Use Create2 to know contract address before it is deployed.
contract DeployWithCreate2 {
address public owner;
constructor(address _owner) {
owner = _owner;
}
}
contract Create2Factory {
@thurendous
thurendous / getMumbaiMaticToken.js
Created October 31, 2022 12:02
Get Mumbai Matic Token
import fetch from ‘node-fetch’;
const getAddress = () => {
const address = process.argv[2];
if (!address) {
console.log(`Please add the address as script argument`);
process.exit(1);
}
return address;
};
const getMatic = async (address) => {
@thurendous
thurendous / TODO_LIST.md
Last active October 29, 2022 14:28
The todo-list and ideas for Omaeno

TODOs

  • Create a page to function as calculator for units like ether, gwei or wei.
    • Create a Unit Converter for USDT/USDC(decimal 6)
    • Create a coppy button
    • create a hex->10 function
  • Create an article to show how to understand the Crypto scene's languages including memes
  • Create a webhook to integrate with discord
  • Create a function for searching
  • Create a twitter bot to tweet about JPYC whale alert
  • Pull uniswap price data as oracle data into website page
@thurendous
thurendous / MultiSigWallet.sol
Last active July 2, 2022 02:04
A multi-sig wallet example for study
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract MultiSigWallet {
event Deposit(address indexed sender, uint amount );
event Submit(uint indexed txId);
event Approve(address indexed owner, uint indexed txId);
event Revoke(address indexed owner, uint indexed txId);
event Execute(uint indexed txId);
@thurendous
thurendous / readme.md
Last active April 7, 2022 09:15
My First Gist

Add a line here

@thurendous
thurendous / .commit_template
Created March 30, 2022 01:20 — forked from Jung0/.commit_template
🤘 Emoji prefix to use at commit message
# ==================== Emojis ====================
# 🎉 :tada: 初めてのコミット(Initial Commit)
# 🔖 :bookmark: バージョンタグ(Version Tag)
# ✨ :sparkles: 新機能(New Feature)
# 🐛 :bug: バグ修正(Bagfix)
# ♻️ :recycle: リファクタリング(Refactoring)
# 📚 :books: ドキュメント(Documentation)
# 🎨 :art: デザインUI/UX(Accessibility)