Skip to content

Instantly share code, notes, and snippets.

View the-first-elder's full-sized avatar

the-first-elder the-first-elder

View GitHub Profile
@the-first-elder
the-first-elder / .sol
Created October 14, 2025 16:34
sample
contract MaceDcaManagerTest is Test {
MaceDcaManagerScript deployer;
MaceDcaManager maceDcaManager;
address initialOwner = 0x748DE9BFBDD651bD461a1cf95F9D8c6F7ab93B06;
IERC20 shmon = IERC20(0x3a98250F98Dd388C211206983453837C8365BDc1);
address fastlaneAddressHub = 0xC9f0cDE8316AbC5Efc8C3f5A6b571e815C021B51;
address payable public constant dexRouter = payable(0x5cdE7aD5D6657c09a35fE56E7D2532048728665d);
address user = 0x748DE9BFBDD651bD461a1cf95F9D8c6F7ab93B06;
@the-first-elder
the-first-elder / .js
Created January 19, 2025 22:26
stark js
import React, { useState } from "react";
import { Provider, Account, ec, number } from "starknet";
const StarknetTransaction = () => {
const [txHash, setTxHash] = useState(null);
const sendTransaction = async () => {
try {
const provider = new Provider({ baseUrl: "https://alpha4.starknet.io" });
@the-first-elder
the-first-elder / txt
Last active September 18, 2024 19:19
715398979
use starknet::ContractAddress;
#[derive(Copy, Clone, Drop, Debug, PartialEq, Serde, starknet::Store)]
pub struct UsersInfo {
pub name: felt252,
pub bio: felt252,
pub status: Status,
}
#[derive(Copy, Drop, Debug, PartialEq, Serde, starknet::Store)]
pub enum Status {
{
"name": "hardhat-project",
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.6",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.8",
"@nomicfoundation/ignition-core": "^0.15.5",
"ethers": "^6.13.1",
"hardhat": "^2.22.5"
@the-first-elder
the-first-elder / call.sol
Created July 18, 2024 19:52
low level call, abi encode and decode
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Encoder {
uint public num1 = 0;
uint public num2 = 1;
function encode(string memory name) public pure returns(bytes memory){
return abi.encode(name);
@the-first-elder
the-first-elder / NigerianContract.sol
Created July 12, 2024 20:06
Nigerian distribution
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./NgnNft.sol";
import "./NgnToken.sol";
contract NigerianContract {
NgnNft public ngnNft; // address 0
NgnToken public ngnToken; // address 0
// rules of my lotteery contract
// 1. min everybody must deposit 0.01 ether;
// when 100 people have deposited pick a random winner
// send the money to the person
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Lottery{
error InsufficentAmount(uint amountSent, uint amountExpected);
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
// a contract that allows deposit and withdrawal of funds.... 1
// modify it to become a lottery contract....
// deploy it sepolia testnet
// verify the contract....
// sepolia, mumbai, goerli,rinskeby
// SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;
contract ageCalculator{
uint public davidAge = 0;
uint public ayoAge = 2;
uint public UgoAge = 3000;