diff --git a/README.md b/README.md index 7f86c36..9552e4d 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,41 @@ Idle game & shitcoin advanture dedicated to cohort VII of Raid Guild. ## Set up for local DEV -### 1. Run `anvil` to setup local RPC +### 1. Run `anvil` to setup local RPC as a fork of base mainnet + +`anvil --fork-url --block-time 10 --chain-id 31337` + +You can get a free rpc url by registering with https://alchemy.com and creating an app + +Be sure to set --chain-id to 31337 if you are forking mainnet base, otherwise it will deploy with Base chain id and metamask will glitch out. ### 2. Deploy contract -Either use `./deploy_contract.sh` script (!! change contract values and set private key to $DEV_PRIVATE_KEY for it to work) or call those things by hand. +Use `./deploy_contract.sh` script + +This will deploy the contract and give you ETH and DAO Token (RGCVII) funds. + +1. Make sure to change `DEV_WALLET` var to your own. +2. Make sure you have your private key on `DEV_PRIVATE_KEY` environment variable + +Alternatively, check the script and run the steps as you see fit. ### 3. Run dev app Move to `app` dir, install deps via `npm install` and run `npm run dev` to start the dev server. -#### 3. 1. Run `cast rpc anvil_mine` +#### 3. 1. Point Metamask to Anvil network for local dev -This is so time gets set on the local chain, otherwise you will start at 0 time and first mint will give you bajillion GELD. +Add network `http://127.0.0.1:8545` with chain id `31337` -#### 3. 2. Point Metamask to Anvil network for local dev +#### 3. 2. Change `app/contract_address.ts` to match your program address if needed -#### 3. 3. Change `app/contract_address.ts` to match your program address if needed +#### 3. 3. Reset metamask transaction history between anvil deployments -### 4. Local development requires mining blocks by hand +If u re-run `anvil` and redeploy the contract, do clear your history in Metamask under Advanced Settings, otherwise Metamask glitches because of its cache (?) -Call `cast rpc anvil_mine` to mine next block, otherwise it wont ever progress and time "stands still" as far as the game is concerned +### 4. Fork tests + +Run `forge test --rpc-url ` + +You can get a free rpc url by registering with https://alchemy.com and creating an app diff --git a/app/contract_address.ts b/app/contract_address.ts index 712d987..620cb43 100644 --- a/app/contract_address.ts +++ b/app/contract_address.ts @@ -1,4 +1,8 @@ -const contractAddress = "0xbd06B0878888bf4c6895704fa603a5ADf7e65c66"; +import { Address } from "viem" +const contracts: Record = { + contractAddress: "0xbd06B0878888bf4c6895704fa603a5ADf7e65c66", + daoTokenAddress: "0x11dC980faf34A1D082Ae8A6a883db3A950a3c6E8" +} -export default contractAddress +export default contracts diff --git a/app/public/loader/hamster.png b/app/public/loader/hamster.png new file mode 100644 index 0000000..7766764 Binary files /dev/null and b/app/public/loader/hamster.png differ diff --git a/app/public/loader/hamster_stand.png b/app/public/loader/hamster_stand.png new file mode 100644 index 0000000..d5c0a02 Binary files /dev/null and b/app/public/loader/hamster_stand.png differ diff --git a/app/public/loader/hamster_wheel.png b/app/public/loader/hamster_wheel.png new file mode 100644 index 0000000..e74c555 Binary files /dev/null and b/app/public/loader/hamster_wheel.png differ diff --git a/app/src/components/Header.tsx b/app/src/components/Header.tsx index cf88274..60eecdf 100644 --- a/app/src/components/Header.tsx +++ b/app/src/components/Header.tsx @@ -5,10 +5,12 @@ import { usePlayer } from "../providers/PlayerProvider"; import { useAccount } from 'wagmi'; import dynamic from "next/dynamic"; import Counter, { toReadable } from "./Counter"; +import { useModal } from "../providers/ModalProvider"; const Header = () => { const { isConnected } = useAccount(); - const { isRegistered, register, army } = usePlayer(); + const { isRegistered, army } = usePlayer(); + const { openRegistrationModal } = useModal(); const title = useMemo(() => { return isRegistered ? `SLAY THE MOLOCH` : @@ -33,8 +35,8 @@ const Header = () => { const onRegister = useCallback(() => { if (isRegistered) return - register(); - }, [isRegistered, register]) + openRegistrationModal() + }, [isRegistered, openRegistrationModal]) return

{title}

diff --git a/app/src/components/RegistrationModal.tsx b/app/src/components/RegistrationModal.tsx new file mode 100644 index 0000000..0161a9e --- /dev/null +++ b/app/src/components/RegistrationModal.tsx @@ -0,0 +1,26 @@ +import { useCallback } from "react"; +import { usePlayer } from "../providers/PlayerProvider"; +import styles from "../styles/Modal.module.css"; + +interface RegistrationModalProps { + isOpen: boolean; + setIsOpen: (val: boolean) => void +} + +const RegistrationModal = ({ isOpen, setIsOpen }: RegistrationModalProps) => { + const { register } = usePlayer() + const onRegister = useCallback((mode: "ETH" | "RGCVII") => { + register(mode); + setIsOpen(false); + }, [register, setIsOpen]) + if (!isOpen) return null; + return
+

Insert coins to continue

+
+ + +
+
+} + +export default RegistrationModal diff --git a/app/src/components/WaitingForTxModal.tsx b/app/src/components/WaitingForTxModal.tsx new file mode 100644 index 0000000..be8ccde --- /dev/null +++ b/app/src/components/WaitingForTxModal.tsx @@ -0,0 +1,31 @@ +import { useEffect } from "react"; +import { Hash } from "viem" +import { useWaitForTransactionReceipt } from "wagmi"; +import styles from "../styles/Modal.module.css" + +interface WaitingForTxModalProps { + hash: Hash, + callbackFn: () => void; +} + +const WaitingForTxModal = ({ + hash, + callbackFn +}: WaitingForTxModalProps) => { + const { isFetched } = useWaitForTransactionReceipt({ hash }) + useEffect(() => { + if (isFetched) { + callbackFn() + } + }, [isFetched, callbackFn]) + return
+
+
+
+
+
+

Writing contract ...

+
+} + +export default WaitingForTxModal diff --git a/app/src/pages/_app.tsx b/app/src/pages/_app.tsx index 311d09a..533f4e8 100644 --- a/app/src/pages/_app.tsx +++ b/app/src/pages/_app.tsx @@ -8,6 +8,8 @@ import { RainbowKitProvider, midnightTheme } from "@rainbow-me/rainbowkit"; import { config } from "../wagmi"; import { Press_Start_2P, Texturina } from "next/font/google"; import PlayerProvider from "../providers/PlayerProvider"; +import ModalProvider from '../providers/ModalProvider'; + const client = new QueryClient(); const font = Texturina({ weight: ["400"], subsets: ["latin"] }); @@ -42,7 +44,9 @@ function MyApp({ Component, pageProps }: AppProps) { } `} - + + + diff --git a/app/src/providers/ModalProvider.tsx b/app/src/providers/ModalProvider.tsx new file mode 100644 index 0000000..058ae10 --- /dev/null +++ b/app/src/providers/ModalProvider.tsx @@ -0,0 +1,33 @@ +import React, { createContext, ReactNode, useCallback, useContext, useState } from 'react' +import RegistrationModal from '../components/RegistrationModal'; + + +export interface PlayerContextType { + openRegistrationModal: () => void +} + +const ModalContext = createContext({ + openRegistrationModal: () => { } +}); + +const ModalProvider = ({ children }: { children: ReactNode }) => { + const [registrationModalOpen, setIsRegistrationModalOpen] = useState(false) + const openRegistrationModal = useCallback(() => { + setIsRegistrationModalOpen(true) + }, []) + return ( + + {children} + + + ); +} + +export const useModal = () => { + return useContext(ModalContext); +} + +export default ModalProvider + diff --git a/app/src/providers/PlayerProvider.tsx b/app/src/providers/PlayerProvider.tsx index 7f44202..0aec1a4 100644 --- a/app/src/providers/PlayerProvider.tsx +++ b/app/src/providers/PlayerProvider.tsx @@ -1,9 +1,11 @@ -import React, { createContext, ReactNode, useCallback, useContext, useEffect } from 'react' +import React, { createContext, ReactNode, useCallback, useContext, useEffect, useState } from 'react' import { useAccount, useReadContract, useWriteContract } from 'wagmi' import contractAbi from "../../../out/RaidGeld.sol/RaidGeld.json" -import { parseEther } from 'viem' -import contractAddress from '../../contract_address' +import { Hash, parseEther } from 'viem' +import contracts from '../../contract_address' +import WaitingForTxModal from '../components/WaitingForTxModal' +const { contractAddress, daoTokenAddress } = contracts const abi = contractAbi.abi export type UnitType = 0 | 1 | 2 | 3 @@ -26,7 +28,7 @@ export interface PlayerContextType { player: null | Player, army: null | Army, balance: bigint, - register: () => void, + register: (arg: "ETH" | "RGCVII") => void, raid: () => void, addUnit: (unit: UnitType) => void } @@ -44,11 +46,16 @@ const PlayerContext = createContext({ const PlayerProvider = ({ children }: { children: ReactNode }) => { const { address, isConnected } = useAccount(); const { writeContract, error } = useWriteContract(); + const [[txHash, callbackFn], setHashAndCallback] = useState<[Hash | null, () => void]>([null, () => { }]) useEffect(() => { console.warn(error) }, [error]) + const resetHashAndCallback = useCallback(() => { + setHashAndCallback([null, () => { }]) + }, []) + const { data: isRegistered } = useReadContract({ address: contractAddress, abi, @@ -56,7 +63,7 @@ const PlayerProvider = ({ children }: { children: ReactNode }) => { args: [address], query: { enabled: isConnected, - refetchInterval: 5, + refetchInterval: 15, } }); @@ -66,7 +73,7 @@ const PlayerProvider = ({ children }: { children: ReactNode }) => { functionName: 'balanceOf', args: [address], query: { - refetchInterval: 5, + refetchInterval: 15, enabled: isConnected } }); @@ -95,14 +102,42 @@ const PlayerProvider = ({ children }: { children: ReactNode }) => { console.log(balance, player, army) - const register = useCallback(() => { - writeContract({ - abi, - address: contractAddress, - functionName: 'register', - value: parseEther("0.00005"), - }) - }, [writeContract]) + const register = useCallback((arg: "RGCVII" | "ETH") => { + if (arg === 'ETH') { + writeContract({ + abi, + address: contractAddress, + functionName: 'register_eth', + value: parseEther("0.00005"), + }, { + onSuccess: (hash) => { + setHashAndCallback([hash, resetHashAndCallback]) + } + }) + } else if (arg === "RGCVII") { + writeContract({ + abi, + address: daoTokenAddress, + functionName: 'approve', + args: [contractAddress, parseEther("50")], + }, { + onSuccess: (hash) => { + setHashAndCallback([ + hash, + () => writeContract({ + abi, + address: contractAddress, + functionName: 'register_dao', + }, { + onSuccess: (hash) => { + setHashAndCallback([hash, resetHashAndCallback]) + } + }) + ]) + } + }); + } + }, [writeContract, resetHashAndCallback]) const raid = useCallback(() => { writeContract({ @@ -132,6 +167,7 @@ const PlayerProvider = ({ children }: { children: ReactNode }) => { addUnit }}> {children} + {txHash && } ); } diff --git a/app/src/styles/Modal.module.css b/app/src/styles/Modal.module.css new file mode 100644 index 0000000..a1ec842 --- /dev/null +++ b/app/src/styles/Modal.module.css @@ -0,0 +1,67 @@ +.modal { + position: fixed; + margin: 0 auto; + height: auto; + background: var(--bg-color); + border-width: 8px; + border-image: url("/background/frame.png") 22 fill / auto space; + padding: 44px; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + & button { + font-size: 1.4rem; + margin: 0 11px; + } + & h2 { + margin-top: 0; + } + .loadingImage { + position: relative; + width: 240px; + height: 240px; + } + .loadingHamster { + position: absolute; + background-image: url("/loader/hamster.png"); + width: 240px; + height: 240px; + animation: jump 0.2s ease infinite; + } + .loadingHamsterWheel { + position: absolute; + background-image: url("/loader/hamster_wheel.png"); + width: 240px; + height: 240px; + animation: spin 3.5s linear infinite; + } + .loadingHamsterWheelStand { + position: absolute; + background-image: url("/loader/hamster_stand.png"); + width: 240px; + height: 240px; + } + .loadingText { + text-align: center; + font-size: 1.1rem; + margin-bottom: 0; + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} +@keyframes jump { + 0%, + 100% { + transform: translate(0, 0); + } + 50% { + transform: translate(0, -10px); + } +} diff --git a/app/src/styles/globals.css b/app/src/styles/globals.css index 8da1309..ad4aa7a 100644 --- a/app/src/styles/globals.css +++ b/app/src/styles/globals.css @@ -1,5 +1,6 @@ :root { --bg-color: #1a1a1a; + --bg-color-button: #000; --text-color: #ffffff; --accent-color: #f00000; --border-color: #800000; @@ -40,8 +41,8 @@ a:hover { } button { - background-color: var(--accent-color); - color: var(--bg-color); + background-color: var(--bg-color-button); + color: var(--text-color); border: 2px solid var(--border-color); padding: 10px; cursor: pointer; @@ -49,6 +50,7 @@ button { button:hover { background-color: var(--hover-color); + color: var(--bg-color-button); } header, diff --git a/broadcast/RaidGeld.s.sol/84532/run-1729696549.json b/broadcast/RaidGeld.s.sol/84532/run-1729696549.json deleted file mode 100644 index 0a1ec0c..0000000 --- a/broadcast/RaidGeld.s.sol/84532/run-1729696549.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x9d39df7a47137565fa4dfd579c92e4a90db9ae54490630585e878d7313ce15a7", - "transactionType": "CREATE", - "contractName": "RaidGeld", - "contractAddress": "0xbd06b0878888bf4c6895704fa603a5adf7e65c66", - "function": null, - "arguments": null, - "transaction": { - "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", - "gas": "0x1c21ce", - "value": "0x0", - "input": "0x608060405234801561001057600080fd5b50336040518060400160405280600981526020016814985a590811d95b1960ba1b8152506040518060400160405280600481526020016311d1531160e21b8152508160039081610060919061019e565b50600461006d828261019e565b5050506001600160a01b03811661009e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100a7816100ad565b5061025c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061012957607f821691505b60208210810361014957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561019957806000526020600020601f840160051c810160208510156101765750805b601f840160051c820191505b818110156101965760008155600101610182565b50505b505050565b81516001600160401b038111156101b7576101b76100ff565b6101cb816101c58454610115565b8461014f565b6020601f8211600181146101ff57600083156101e75750848201515b600019600385901b1c1916600184901b178455610196565b600084815260208120601f198516915b8281101561022f578785015182556020948501946001909201910161020f565b508482101561024d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6117478061026b6000396000f3fe6080604052600436106101395760003560e01c806370a08231116100ab578063a7db742f1161006f578063a7db742f14610530578063a9059cbb14610545578063c3c5a54714610565578063c861dcb1146105a0578063dd62ed3e146105b5578063f2fde38b146105fb576101b1565b806370a0823114610488578063715018a6146104be57806385ed706d146104d35780638da5cb5b146104f357806395d89b411461051b576101b1565b806323b872dd116100fd57806323b872dd14610296578063313ce567146102b65780633ccfd60b146102d257806347d1e46e146102e757806353d7da60146103015780635c12cd4b14610446576101b1565b806306fdde03146101f9578063095ea7b31461022457806313820ba71461025457806318160ddd146102775780631aa3a0081461028c576101b1565b366101b15760405162461bcd60e51b815260206004820152603f60248201527f4e6f20706c61696e2045746865722061636365707465642c207573652072656760448201527f697374657228292066756e6374696f6e20746f20636865636b20696e203a290060648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152601a60248201527f4e6f2066616c6c6261636b2063616c6c7320616363657074656400000000000060448201526064016101a8565b34801561020557600080fd5b5061020e61061b565b60405161021b9190611396565b60405180910390f35b34801561023057600080fd5b5061024461023f366004611400565b6106ad565b604051901515815260200161021b565b34801561026057600080fd5b50610269600f81565b60405190815260200161021b565b34801561028357600080fd5b50600254610269565b6102946106c7565b005b3480156102a257600080fd5b506102446102b136600461142a565b6108ab565b3480156102c257600080fd5b506040516004815260200161021b565b3480156102de57600080fd5b506102946108cf565b3480156102f357600080fd5b50610269652d79883d200081565b34801561030d57600080fd5b506103f061031c366004611467565b6040805160c081018252600060a082018181528252825160208082018552828252808401919091528351808201855282815283850152835190810190935280835260608201929092526080810191909152506001600160a01b0316600090815260076020908152604091829020825160c081018452815461ffff90811660a08301908152825284518085018652600184015482168152828501528451808501865260028401548216815282860152845193840190945260038201549093168252606083019190915260040154608082015290565b60405161021b9190600060a08201905061ffff83515116825261ffff60208401515116602083015261ffff60408401515116604083015261ffff6060840151511660608301526080830151608083015292915050565b34801561045257600080fd5b50610466610461366004611467565b610913565b604080518251815260208084015190820152918101519082015260600161021b565b34801561049457600080fd5b506102696104a3366004611467565b6001600160a01b031660009081526020819052604090205490565b3480156104ca57600080fd5b50610294610979565b3480156104df57600080fd5b506102946104ee366004611489565b61098d565b3480156104ff57600080fd5b506005546040516001600160a01b03909116815260200161021b565b34801561052757600080fd5b5061020e610c64565b34801561053c57600080fd5b50610294610c73565b34801561055157600080fd5b50610244610560366004611400565b610daf565b34801561057157600080fd5b50610244610580366004611467565b6001600160a01b0316600090815260066020526040902060010154151590565b3480156105ac57600080fd5b50610269610dbd565b3480156105c157600080fd5b506102696105d03660046114cf565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561060757600080fd5b50610294610616366004611467565b610dd7565b60606003805461062a90611502565b80601f016020809104026020016040519081016040528092919081815260200182805461065690611502565b80156106a35780601f10610678576101008083540402835291602001916106a3565b820191906000526020600020905b81548152906001019060200180831161068657829003601f168201915b5050505050905090565b6000336106bb818585610e12565b60019150505b92915050565b33600090815260066020526040902060010154156107275760405162461bcd60e51b815260206004820181905260248201527f57686f6f70732c20706c6179657220616c726561647920657869737473203a2960448201526064016101a8565b652d79883d2000341461077c5760405162461bcd60e51b815260206004820152601760248201527f496e636f72726563742062757920696e20616d6f756e7400000000000000000060448201526064016101a8565b61079c3361078c6004600a611639565b610797906032611648565b610e24565b60405180606001604052806004600a6107b59190611639565b6107c0906032611648565b815242602080830182905260409283019190915233600081815260068352838120855181558584015160018083019190915595850151600291820155845160c08101865260a0810183815281528551808601875283815281860190815286518087018852848152828801908152875180880189528581526060840190815260808401868152968652600790975296909320905151815461ffff1990811661ffff92831617835593515197820180548516988216989098179097559451519085018054831691871691909117905591515160038401805490931694169390931790559051600490910155565b6000336108b9858285610e5e565b6108c4858585610edc565b506001949350505050565b6108d7610f3b565b6005546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610910573d6000803e3d6000fd5b50565b61093760405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260066020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b610981610f3b565b61098b6000610f68565b565b3360009081526006602052604081206001015490036109e85760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b60038260ff161115610a2b5760405162461bcd60e51b815260206004820152600c60248201526b155b9adb9bdddb881d5b9a5d60a21b60448201526064016101a8565b3360009081526007602052604081209060ff84168103610a515750805461ffff16610a9b565b8360ff16600103610a6b5750600181015461ffff16610a9b565b8360ff16600203610a855750600281015461ffff16610a9b565b8360ff16600303610a9b5750600381015461ffff165b6000610aa8858386610fba565b336000908152602081905260409020549091508110610b095760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682047454c4420746f206164642074686973206d75636860448201526064016101a8565b610b13338261107c565b8460ff16600003610b5557825484908490600090610b3690849061ffff1661165f565b92506101000a81548161ffff021916908361ffff160217905550610be2565b8460ff16600103610b7b57600183018054859190600090610b3690849061ffff1661165f565b8460ff16600203610ba157600283018054859190600090610b3690849061ffff1661165f565b8460ff16600303610be257600383018054859190600090610bc790849061ffff1661165f565b92506101000a81548161ffff021916908361ffff1602179055505b6040805160c081018252845461ffff90811660a08301908152825282516020818101855260018801548316825280840191909152835180820185526002880154831681528385015283519081019093526003860154168252606081019190915260048401546080820152610c55906110b2565b83600401819055505050505050565b60606004805461062a90611502565b336000908152600660205260408120600101549003610cce5760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b33600090815260066020526040902060020154610ced90600f90611679565b421015610d355760405162461bcd60e51b81526020600482015260166024820152752a3934b2b21036b4b73a34b733903a37b79039b7b7b760511b60448201526064016101a8565b33600090815260066020526040812060020154610d52904261168c565b90506000610d626004600a611639565b33600090815260076020526040902060040154610d80908490611648565b610d8a9190611648565b9050610d963382610e24565b3360009081526006602052604090204260028201555550565b6000336106bb818585610edc565b610dc96004600a611639565b610dd4906032611648565b81565b610ddf610f3b565b6001600160a01b038116610e0957604051631e4fbdf760e01b8152600060048201526024016101a8565b61091081610f68565b610e1f8383836001611197565b505050565b6001600160a01b038216610e4e5760405163ec442f0560e01b8152600060048201526024016101a8565b610e5a6000838361126c565b5050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610ed65781811015610ec757604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016101a8565b610ed684848484036000611197565b50505050565b6001600160a01b038316610f0657604051634b637e8f60e11b8152600060048201526024016101a8565b6001600160a01b038216610f305760405163ec442f0560e01b8152600060048201526024016101a8565b610e1f83838361126c565b6005546001600160a01b0316331461098b5760405163118cdaa760e01b81523360048201526024016101a8565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060038460ff1611156110095760405162461bcd60e51b8152602060048201526016602482015275139bc81b585d18da1a5b99c81d5b9a5d08199bdd5b9960521b60448201526064016101a8565b600061101960ff86166026611648565b90506000607360015b61102c868861165f565b61ffff168110156110705760646110438386611648565b61104d91906116b5565b93508661ffff16811115611068576110658484611679565b92505b600101611022565b50909695505050505050565b6001600160a01b0382166110a657604051634b637e8f60e11b8152600060048201526024016101a8565b610e5a8260008361126c565b80515160208201515160009161ffff16908290600a906110d390603d6116c9565b6110dd91906116ed565b61ffff1690506000600a85604001516000015160066110fc91906116c9565b6111079060406116c9565b61111191906116ed565b61ffff1690506000600a80600a886060015160000151603d61113391906116c9565b61113d91906116ed565b6111489060406116c9565b61115291906116ed565b61115d9060436116c9565b61116791906116ed565b61ffff16905080826111798587611679565b6111839190611679565b61118d9190611679565b9695505050505050565b6001600160a01b0384166111c15760405163e602df0560e01b8152600060048201526024016101a8565b6001600160a01b0383166111eb57604051634a1406b160e11b8152600060048201526024016101a8565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610ed657826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161125e91815260200190565b60405180910390a350505050565b6001600160a01b03831661129757806002600082825461128c9190611679565b909155506113099050565b6001600160a01b038316600090815260208190526040902054818110156112ea5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016101a8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661132557600280548290039055611344565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161138991815260200190565b60405180910390a3505050565b602081526000825180602084015260005b818110156113c457602081860181015160408684010152016113a7565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146113fb57600080fd5b919050565b6000806040838503121561141357600080fd5b61141c836113e4565b946020939093013593505050565b60008060006060848603121561143f57600080fd5b611448846113e4565b9250611456602085016113e4565b929592945050506040919091013590565b60006020828403121561147957600080fd5b611482826113e4565b9392505050565b6000806040838503121561149c57600080fd5b823560ff811681146114ad57600080fd5b9150602083013561ffff811681146114c457600080fd5b809150509250929050565b600080604083850312156114e257600080fd5b6114eb836113e4565b91506114f9602084016113e4565b90509250929050565b600181811c9082168061151657607f821691505b60208210810361153657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001815b600184111561158d578085048111156115715761157161153c565b600184161561157f57908102905b60019390931c928002611556565b935093915050565b6000826115a4575060016106c1565b816115b1575060006106c1565b81600181146115c757600281146115d1576115ed565b60019150506106c1565b60ff8411156115e2576115e261153c565b50506001821b6106c1565b5060208310610133831016604e8410600b8410161715611610575081810a6106c1565b61161d6000198484611552565b80600019048211156116315761163161153c565b029392505050565b600061148260ff841683611595565b80820281158282048414176106c1576106c161153c565b61ffff81811683821601908111156106c1576106c161153c565b808201808211156106c1576106c161153c565b818103818111156106c1576106c161153c565b634e487b7160e01b600052601260045260246000fd5b6000826116c4576116c461169f565b500490565b61ffff81811683821602908116908181146116e6576116e661153c565b5092915050565b600061ffff8316806117015761170161169f565b8061ffff8416049150509291505056fea2646970667358221220061f190eb2f6fddd15161a6db096edf6e4a5b06217867d89e6792c032ada56e764736f6c634300081c0033", - "nonce": "0x0", - "chainId": "0x14a34" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0x3dfdcd", - "logs": [ - { - "address": "0xbd06b0878888bf4c6895704fa603a5adf7e65c66", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000003295cca2d922c637d35b258fc6c9c7e471803b45" - ], - "data": "0x", - "blockHash": "0xe82c2fd01054c42c857cd623a9f0bd0486c97c47b55d8504798371063e4a1614", - "blockNumber": "0x102da20", - "transactionHash": "0x9d39df7a47137565fa4dfd579c92e4a90db9ae54490630585e878d7313ce15a7", - "transactionIndex": "0xe", - "logIndex": "0x19", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000800008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000100000000000000020000000000000000000800000000000004000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000010000000000000001000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0x9d39df7a47137565fa4dfd579c92e4a90db9ae54490630585e878d7313ce15a7", - "transactionIndex": "0xe", - "blockHash": "0xe82c2fd01054c42c857cd623a9f0bd0486c97c47b55d8504798371063e4a1614", - "blockNumber": "0x102da20", - "gasUsed": "0x15a576", - "effectiveGasPrice": "0xa0f5edca", - "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", - "to": null, - "contractAddress": "0xbd06b0878888bf4c6895704fa603a5adf7e65c66", - "l1BaseFeeScalar": "0x44d", - "l1BlobBaseFee": "0x3", - "l1BlobBaseFeeScalar": "0xa118b", - "l1Fee": "0x22c9f9127e", - "l1GasPrice": "0x84641d16", - "l1GasUsed": "0xeeab" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1729696549, - "chain": 84532, - "commit": "830beab" -} \ No newline at end of file diff --git a/broadcast/RaidGeld.s.sol/84532/run-1729773387.json b/broadcast/RaidGeld.s.sol/84532/run-1729773387.json deleted file mode 100644 index 76fb6d9..0000000 --- a/broadcast/RaidGeld.s.sol/84532/run-1729773387.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "transactions": [ - { - "hash": "0xd4fa77c04f44634b166b7ae80cabe097cf35d8d38ea569e499b73310623501d9", - "transactionType": "CREATE", - "contractName": "RaidGeld", - "contractAddress": "0x3572a80eb8df722c98814290f86be29141859660", - "function": null, - "arguments": null, - "transaction": { - "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", - "gas": "0x1c9543", - "value": "0x0", - "input": "0x608060405234801561001057600080fd5b50336040518060400160405280600981526020016814985a590811d95b1960ba1b8152506040518060400160405280600481526020016311d1531160e21b8152508160039081610060919061019e565b50600461006d828261019e565b5050506001600160a01b03811661009e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100a7816100ad565b5061025c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061012957607f821691505b60208210810361014957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561019957806000526020600020601f840160051c810160208510156101765750805b601f840160051c820191505b818110156101965760008155600101610182565b50505b505050565b81516001600160401b038111156101b7576101b76100ff565b6101cb816101c58454610115565b8461014f565b6020601f8211600181146101ff57600083156101e75750848201515b600019600385901b1c1916600184901b178455610196565b600084815260208120601f198516915b8281101561022f578785015182556020948501946001909201910161020f565b508482101561024d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6117b08061026b6000396000f3fe6080604052600436106101395760003560e01c806370a08231116100ab578063a7db742f1161006f578063a7db742f14610530578063a9059cbb14610545578063c3c5a54714610565578063c861dcb1146105a0578063dd62ed3e146105b5578063f2fde38b146105fb576101b1565b806370a0823114610488578063715018a6146104be57806385ed706d146104d35780638da5cb5b146104f357806395d89b411461051b576101b1565b806323b872dd116100fd57806323b872dd14610296578063313ce567146102b65780633ccfd60b146102d257806347d1e46e146102e757806353d7da60146103015780635c12cd4b14610446576101b1565b806306fdde03146101f9578063095ea7b31461022457806313820ba71461025457806318160ddd146102775780631aa3a0081461028c576101b1565b366101b15760405162461bcd60e51b815260206004820152603f60248201527f4e6f20706c61696e2045746865722061636365707465642c207573652072656760448201527f697374657228292066756e6374696f6e20746f20636865636b20696e203a290060648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152601a60248201527f4e6f2066616c6c6261636b2063616c6c7320616363657074656400000000000060448201526064016101a8565b34801561020557600080fd5b5061020e61061b565b60405161021b91906113e6565b60405180910390f35b34801561023057600080fd5b5061024461023f366004611450565b6106ad565b604051901515815260200161021b565b34801561026057600080fd5b50610269600f81565b60405190815260200161021b565b34801561028357600080fd5b50600254610269565b6102946106c7565b005b3480156102a257600080fd5b506102446102b136600461147a565b6108ab565b3480156102c257600080fd5b506040516004815260200161021b565b3480156102de57600080fd5b506102946108cf565b3480156102f357600080fd5b50610269652d79883d200081565b34801561030d57600080fd5b506103f061031c3660046114b7565b6040805160c081018252600060a082018181528252825160208082018552828252808401919091528351808201855282815283850152835190810190935280835260608201929092526080810191909152506001600160a01b0316600090815260076020908152604091829020825160c081018452815461ffff90811660a08301908152825284518085018652600184015482168152828501528451808501865260028401548216815282860152845193840190945260038201549093168252606083019190915260040154608082015290565b60405161021b9190600060a08201905061ffff83515116825261ffff60208401515116602083015261ffff60408401515116604083015261ffff6060840151511660608301526080830151608083015292915050565b34801561045257600080fd5b506104666104613660046114b7565b610913565b604080518251815260208084015190820152918101519082015260600161021b565b34801561049457600080fd5b506102696104a33660046114b7565b6001600160a01b031660009081526020819052604090205490565b3480156104ca57600080fd5b50610294610979565b3480156104df57600080fd5b506102946104ee3660046114d9565b61098d565b3480156104ff57600080fd5b506005546040516001600160a01b03909116815260200161021b565b34801561052757600080fd5b5061020e610c83565b34801561053c57600080fd5b50610294610c92565b34801561055157600080fd5b50610244610560366004611450565b610d5d565b34801561057157600080fd5b506102446105803660046114b7565b6001600160a01b0316600090815260066020526040902060010154151590565b3480156105ac57600080fd5b50610269610d6b565b3480156105c157600080fd5b506102696105d036600461151f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561060757600080fd5b506102946106163660046114b7565b610d85565b60606003805461062a90611552565b80601f016020809104026020016040519081016040528092919081815260200182805461065690611552565b80156106a35780601f10610678576101008083540402835291602001916106a3565b820191906000526020600020905b81548152906001019060200180831161068657829003601f168201915b5050505050905090565b6000336106bb818585610dc0565b60019150505b92915050565b33600090815260066020526040902060010154156107275760405162461bcd60e51b815260206004820181905260248201527f57686f6f70732c20706c6179657220616c726561647920657869737473203a2960448201526064016101a8565b652d79883d2000341461077c5760405162461bcd60e51b815260206004820152601760248201527f496e636f72726563742062757920696e20616d6f756e7400000000000000000060448201526064016101a8565b61079c3361078c6004600a611689565b610797906032611698565b610dd2565b60405180606001604052806004600a6107b59190611689565b6107c0906032611698565b815242602080830182905260409283019190915233600081815260068352838120855181558584015160018083019190915595850151600291820155845160c08101865260a0810183815281528551808601875283815281860190815286518087018852848152828801908152875180880189528581526060840190815260808401868152968652600790975296909320905151815461ffff1990811661ffff92831617835593515197820180548516988216989098179097559451519085018054831691871691909117905591515160038401805490931694169390931790559051600490910155565b6000336108b9858285610e0c565b6108c4858585610e8a565b506001949350505050565b6108d7610ee9565b6005546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610910573d6000803e3d6000fd5b50565b61093760405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260066020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b610981610ee9565b61098b6000610f16565b565b3360009081526006602052604081206001015490036109e85760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b60038260ff161115610a2b5760405162461bcd60e51b815260206004820152600c60248201526b155b9adb9bdddb881d5b9a5d60a21b60448201526064016101a8565b3360009081526007602052604081209060ff84168103610a515750805461ffff16610a9b565b8360ff16600103610a6b5750600181015461ffff16610a9b565b8360ff16600203610a855750600281015461ffff16610a9b565b8360ff16600303610a9b5750600381015461ffff165b6000610aa96004600a611689565b610ab4868487610f68565b610abe9190611698565b336000908152602081905260409020549091508110610b1f5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682047454c4420746f206164642074686973206d75636860448201526064016101a8565b610b2833611033565b610b3233826110cc565b8460ff16600003610b7457825484908490600090610b5590849061ffff166116af565b92506101000a81548161ffff021916908361ffff160217905550610c01565b8460ff16600103610b9a57600183018054859190600090610b5590849061ffff166116af565b8460ff16600203610bc057600283018054859190600090610b5590849061ffff166116af565b8460ff16600303610c0157600383018054859190600090610be690849061ffff166116af565b92506101000a81548161ffff021916908361ffff1602179055505b6040805160c081018252845461ffff90811660a08301908152825282516020818101855260018801548316825280840191909152835180820185526002880154831681528385015283519081019093526003860154168252606081019190915260048401546080820152610c7490611102565b83600401819055505050505050565b60606004805461062a90611552565b336000908152600660205260408120600101549003610ced5760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b33600090815260066020526040902060020154610d0c90600f906116c9565b421015610d545760405162461bcd60e51b81526020600482015260166024820152752a3934b2b21036b4b73a34b733903a37b79039b7b7b760511b60448201526064016101a8565b61098b33611033565b6000336106bb818585610e8a565b610d776004600a611689565b610d82906032611698565b81565b610d8d610ee9565b6001600160a01b038116610db757604051631e4fbdf760e01b8152600060048201526024016101a8565b61091081610f16565b610dcd83838360016111e7565b505050565b6001600160a01b038216610dfc5760405163ec442f0560e01b8152600060048201526024016101a8565b610e08600083836112bc565b5050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610e845781811015610e7557604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016101a8565b610e84848484840360006111e7565b50505050565b6001600160a01b038316610eb457604051634b637e8f60e11b8152600060048201526024016101a8565b6001600160a01b038216610ede5760405163ec442f0560e01b8152600060048201526024016101a8565b610dcd8383836112bc565b6005546001600160a01b0316331461098b5760405163118cdaa760e01b81523360048201526024016101a8565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060038460ff161115610fb75760405162461bcd60e51b8152602060048201526016602482015275139bc81b585d18da1a5b99c81d5b9a5d08199bdd5b9960521b60448201526064016101a8565b6000610fc48560016116dc565b610fd29060ff166026611698565b905080607360015b610fe486886116af565b61ffff16811015611027576064610ffb8386611698565b611005919061170b565b93508661ffff16811061101f5761101c84846116c9565b92505b600101610fda565b50909695505050505050565b6001600160a01b038116600090815260066020526040812060020154611059904261171f565b905060006110696004600a611689565b6001600160a01b038416600090815260076020526040902060040154611090908490611698565b61109a9190611698565b90506110a68382610dd2565b6001600160a01b0390921660009081526006602052604090204260028201559190915550565b6001600160a01b0382166110f657604051634b637e8f60e11b8152600060048201526024016101a8565b610e08826000836112bc565b80515160208201515160009161ffff16908290600a9061112390603d611732565b61112d9190611756565b61ffff1690506000600a856040015160000151600661114c9190611732565b611157906040611732565b6111619190611756565b61ffff1690506000600a80600a886060015160000151603d6111839190611732565b61118d9190611756565b611198906040611732565b6111a29190611756565b6111ad906043611732565b6111b79190611756565b61ffff16905080826111c985876116c9565b6111d391906116c9565b6111dd91906116c9565b9695505050505050565b6001600160a01b0384166112115760405163e602df0560e01b8152600060048201526024016101a8565b6001600160a01b03831661123b57604051634a1406b160e11b8152600060048201526024016101a8565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610e8457826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516112ae91815260200190565b60405180910390a350505050565b6001600160a01b0383166112e75780600260008282546112dc91906116c9565b909155506113599050565b6001600160a01b0383166000908152602081905260409020548181101561133a5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016101a8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661137557600280548290039055611394565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113d991815260200190565b60405180910390a3505050565b602081526000825180602084015260005b8181101561141457602081860181015160408684010152016113f7565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b038116811461144b57600080fd5b919050565b6000806040838503121561146357600080fd5b61146c83611434565b946020939093013593505050565b60008060006060848603121561148f57600080fd5b61149884611434565b92506114a660208501611434565b929592945050506040919091013590565b6000602082840312156114c957600080fd5b6114d282611434565b9392505050565b600080604083850312156114ec57600080fd5b823560ff811681146114fd57600080fd5b9150602083013561ffff8116811461151457600080fd5b809150509250929050565b6000806040838503121561153257600080fd5b61153b83611434565b915061154960208401611434565b90509250929050565b600181811c9082168061156657607f821691505b60208210810361158657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001815b60018411156115dd578085048111156115c1576115c161158c565b60018416156115cf57908102905b60019390931c9280026115a6565b935093915050565b6000826115f4575060016106c1565b81611601575060006106c1565b816001811461161757600281146116215761163d565b60019150506106c1565b60ff8411156116325761163261158c565b50506001821b6106c1565b5060208310610133831016604e8410600b8410161715611660575081810a6106c1565b61166d60001984846115a2565b80600019048211156116815761168161158c565b029392505050565b60006114d260ff8416836115e5565b80820281158282048414176106c1576106c161158c565b61ffff81811683821601908111156106c1576106c161158c565b808201808211156106c1576106c161158c565b60ff81811683821601908111156106c1576106c161158c565b634e487b7160e01b600052601260045260246000fd5b60008261171a5761171a6116f5565b500490565b818103818111156106c1576106c161158c565b61ffff818116838216029081169081811461174f5761174f61158c565b5092915050565b600061ffff83168061176a5761176a6116f5565b8061ffff8416049150509291505056fea2646970667358221220313cc1e5e86bbb7d3c3ded2bd7a034c1d5ffeb6733733567e3c8f6b4f041b55864736f6c634300081c0033", - "nonce": "0x7", - "chainId": "0x14a34" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0x1f8453", - "logs": [ - { - "address": "0x3572a80eb8df722c98814290f86be29141859660", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000003295cca2d922c637d35b258fc6c9c7e471803b45" - ], - "data": "0x", - "blockHash": "0x9708bb1125f0e43dc1ffc445a674ebbf03f5e0c95bf8f803027fe0b8a64492dd", - "blockNumber": "0x1037033", - "transactionHash": "0xd4fa77c04f44634b166b7ae80cabe097cf35d8d38ea569e499b73310623501d9", - "transactionIndex": "0x7", - "logIndex": "0x7", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000200000000000000800000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001000000000000000000000100000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0xd4fa77c04f44634b166b7ae80cabe097cf35d8d38ea569e499b73310623501d9", - "transactionIndex": "0x7", - "blockHash": "0x9708bb1125f0e43dc1ffc445a674ebbf03f5e0c95bf8f803027fe0b8a64492dd", - "blockNumber": "0x1037033", - "gasUsed": "0x15fe4c", - "effectiveGasPrice": "0x13b3f9", - "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", - "to": null, - "contractAddress": "0x3572a80eb8df722c98814290f86be29141859660", - "l1BaseFeeScalar": "0x44d", - "l1BlobBaseFee": "0x1", - "l1BlobBaseFeeScalar": "0xa118b", - "l1Fee": "0x664fcff1ad", - "l1GasPrice": "0x17fe2ef41", - "l1GasUsed": "0xf211" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1729773387, - "chain": 84532, - "commit": "cb12c77" -} \ No newline at end of file diff --git a/broadcast/RaidGeld.s.sol/84532/run-1730194354.json b/broadcast/RaidGeld.s.sol/84532/run-1730194354.json new file mode 100644 index 0000000..d152539 --- /dev/null +++ b/broadcast/RaidGeld.s.sol/84532/run-1730194354.json @@ -0,0 +1,68 @@ +{ + "transactions": [ + { + "hash": "0xf2704113a36a9f99d71f06e9996046758b23a11e8ad4e599fc6aa2667369cbec", + "transactionType": "CREATE", + "contractName": "RaidGeld", + "contractAddress": "0xc912823b231f5d052ef334a8f8b73f6354909cd0", + "function": null, + "arguments": null, + "transaction": { + "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", + "gas": "0x1c919b", + "value": "0x0", + "input": "0x608060405234801561001057600080fd5b50336040518060400160405280600981526020016814985a590811d95b1960ba1b8152506040518060400160405280600481526020016311d1531160e21b8152508160039081610060919061019e565b50600461006d828261019e565b5050506001600160a01b03811661009e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100a7816100ad565b5061025c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061012957607f821691505b60208210810361014957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561019957806000526020600020601f840160051c810160208510156101765750805b601f840160051c820191505b818110156101965760008155600101610182565b50505b505050565b81516001600160401b038111156101b7576101b76100ff565b6101cb816101c58454610115565b8461014f565b6020601f8211600181146101ff57600083156101e75750848201515b600019600385901b1c1916600184901b178455610196565b600084815260208120601f198516915b8281101561022f578785015182556020948501946001909201910161020f565b508482101561024d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6117ad8061026b6000396000f3fe6080604052600436106101395760003560e01c806370a08231116100ab578063a7db742f1161006f578063a7db742f1461052d578063a9059cbb14610542578063c3c5a54714610562578063c861dcb11461059d578063dd62ed3e146105b2578063f2fde38b146105f8576101b1565b806370a0823114610485578063715018a6146104bb57806385ed706d146104d05780638da5cb5b146104f057806395d89b4114610518576101b1565b80632703984c116100fd5780632703984c1461029d578063313ce567146102b35780633ccfd60b146102cf57806347d1e46e146102e457806353d7da60146102fe5780635c12cd4b14610443576101b1565b806306fdde03146101f9578063095ea7b31461022457806318160ddd146102545780631aa3a0081461027357806323b872dd1461027d576101b1565b366101b15760405162461bcd60e51b815260206004820152603f60248201527f4e6f20706c61696e2045746865722061636365707465642c207573652072656760448201527f697374657228292066756e6374696f6e20746f20636865636b20696e203a290060648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152601a60248201527f4e6f2066616c6c6261636b2063616c6c7320616363657074656400000000000060448201526064016101a8565b34801561020557600080fd5b5061020e610618565b60405161021b9190611542565b60405180910390f35b34801561023057600080fd5b5061024461023f3660046115ac565b6106aa565b604051901515815260200161021b565b34801561026057600080fd5b506002545b60405190815260200161021b565b61027b6106c4565b005b34801561028957600080fd5b506102446102983660046115d6565b6108d4565b3480156102a957600080fd5b5061026561271081565b3480156102bf57600080fd5b506040516004815260200161021b565b3480156102db57600080fd5b5061027b6108f8565b3480156102f057600080fd5b50610265652d79883d200081565b34801561030a57600080fd5b506103ed610319366004611613565b6040805160c081018252600060a082018181528252825160208082018552828252808401919091528351808201855282815283850152835190810190935280835260608201929092526080810191909152506001600160a01b0316600090815260076020908152604091829020825160c081018452815461ffff90811660a08301908152825284518085018652600184015482168152828501528451808501865260028401548216815282860152845193840190945260038201549093168252606083019190915260040154608082015290565b60405161021b9190600060a08201905061ffff83515116825261ffff60208401515116602083015261ffff60408401515116604083015261ffff6060840151511660608301526080830151608083015292915050565b34801561044f57600080fd5b5061046361045e366004611613565b61093c565b604080518251815260208084015190820152918101519082015260600161021b565b34801561049157600080fd5b506102656104a0366004611613565b6001600160a01b031660009081526020819052604090205490565b3480156104c757600080fd5b5061027b6109a2565b3480156104dc57600080fd5b5061027b6104eb366004611635565b6109b6565b3480156104fc57600080fd5b506005546040516001600160a01b03909116815260200161021b565b34801561052457600080fd5b5061020e610df2565b34801561053957600080fd5b5061027b610e01565b34801561054e57600080fd5b5061024461055d3660046115ac565b610ec6565b34801561056e57600080fd5b5061024461057d366004611613565b6001600160a01b0316600090815260066020526040902060010154151590565b3480156105a957600080fd5b50610265610ed4565b3480156105be57600080fd5b506102656105cd36600461167b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561060457600080fd5b5061027b610613366004611613565b610ee4565b606060038054610627906116ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610653906116ae565b80156106a05780601f10610675576101008083540402835291602001916106a0565b820191906000526020600020905b81548152906001019060200180831161068357829003601f168201915b5050505050905090565b6000336106b8818585610f1f565b60019150505b92915050565b33600090815260066020526040902060010154156107245760405162461bcd60e51b815260206004820181905260248201527f57686f6f70732c20706c6179657220616c726561647920657869737473203a2960448201526064016101a8565b652d79883d200034146107795760405162461bcd60e51b815260206004820152601760248201527f496e636f72726563742062757920696e20616d6f756e7400000000000000000060448201526064016101a8565b61078f3361078a61271060326116fe565b610f31565b604051806060016040528061271060326107a991906116fe565b815242602080830182905260409283019190915233600081815260068352838120855181558584015160018083019190915595850151600291820155845160c08101865260a0810183815281528551808601875283815281860190815286518087018852848152828801908152875180880189528581526060840190815260808401868152878752600790985297909420915151825461ffff91821661ffff1991821617845591515198830180549982169983169990991790985592515191810180549288169284169290921790915593515160038501805491909616911617909355516004909101557f324cb0062138d65997c86cd3012489ceb351d602f2f55c7408306e8040c79f3f6108c161271060326116fe565b60405190815260200160405180910390a2565b6000336108e2858285610f6b565b6108ed858585610fe9565b506001949350505050565b610900611048565b6005546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610939573d6000803e3d6000fd5b50565b61096060405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260066020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b6109aa611048565b6109b46000611075565b565b336000908152600660205260408120600101549003610a115760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b60038260ff161115610a545760405162461bcd60e51b815260206004820152600c60248201526b155b9adb9bdddb881d5b9a5d60a21b60448201526064016101a8565b3360009081526007602052604081209060ff84168103610a7a5750805461ffff16610ac4565b8360ff16600103610a945750600181015461ffff16610ac4565b8360ff16600203610aae5750600281015461ffff16610ac4565b8360ff16600303610ac45750600381015461ffff165b6000610ad18583866110c7565b3360009081526006602052604081206002015491925090610af29042611715565b3360009081526007602052604081206004015491925090610b149083906116fe565b90508281610b37336001600160a01b031660009081526020819052604090205490565b610b419190611728565b1015610b8f5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682047454c4420746f20616464207468697320756e697460448201526064016101a8565b6000610b9a336111b9565b9050337f9bb68af0b9250c61b4165d0222a40b0cf3031d652889568c7a962977ac55bad782610bde836001600160a01b031660009081526020819052604090205490565b6040805192835260208301919091520160405180910390a2610c00338561126c565b8760ff16600003610c4257855487908790600090610c2390849061ffff1661173b565b92506101000a81548161ffff021916908361ffff160217905550610ccf565b8760ff16600103610c6857600186018054889190600090610c2390849061ffff1661173b565b8760ff16600203610c8e57600286018054889190600090610c2390849061ffff1661173b565b8760ff16600303610ccf57600386018054889190600090610cb490849061ffff1661173b565b92506101000a81548161ffff021916908361ffff1602179055505b6040805160c081018252875461ffff90811660a08301908152825282516020818101855260018b015483168252808401919091528351808201855260028b0154831681528385015283519081019093526003890154168252606081019190915260048701546080820152610d42906112a2565b6004870155337f8579d59c2c4a77507a254640c7496d382c314ebc6d3656c163c4f0ce1e47d7d5898987610d8b856001600160a01b031660009081526020819052604090205490565b8b5460018d015460028e015460038f01546040805160ff909916895261ffff97881660208a015288019590955260608701939093529084166080860152831660a0850152821660c08401521660e08201526101000160405180910390a25050505050505050565b606060048054610627906116ae565b336000908152600660205260408120600101549003610e5c5760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b6000610e67336111b9565b9050337f9bb68af0b9250c61b4165d0222a40b0cf3031d652889568c7a962977ac55bad782610eab836001600160a01b031660009081526020819052604090205490565b6040805192835260208301919091520160405180910390a250565b6000336106b8818585610fe9565b610ee161271060326116fe565b81565b610eec611048565b6001600160a01b038116610f1657604051631e4fbdf760e01b8152600060048201526024016101a8565b61093981611075565b610f2c8383836001611343565b505050565b6001600160a01b038216610f5b5760405163ec442f0560e01b8152600060048201526024016101a8565b610f6760008383611418565b5050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610fe35781811015610fd457604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016101a8565b610fe384848484036000611343565b50505050565b6001600160a01b03831661101357604051634b637e8f60e11b8152600060048201526024016101a8565b6001600160a01b03821661103d5760405163ec442f0560e01b8152600060048201526024016101a8565b610f2c838383611418565b6005546001600160a01b031633146109b45760405163118cdaa760e01b81523360048201526024016101a8565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060038460ff1611156111165760405162461bcd60e51b8152602060048201526016602482015275139bc81b585d18da1a5b99c81d5b9a5d08199bdd5b9960521b60448201526064016101a8565b6205cc60600060ff86166001036111325762342f60915061115c565b8560ff16600203611149576301cb3a80915061115c565b8560ff1660030361115c57630f3f714091505b60005b611169858761173b565b61ffff168110156111af578561ffff16811061118c576111898383611728565b91505b61271061119b612cec856116fe565b6111a59190611755565b925060010161115f565b5095945050505050565b6001600160a01b03811660009081526006602052604081206002015481906111e19042611715565b6001600160a01b0384166000908152600760205260408120600401549192509061120c9083906116fe565b90506112188482610f31565b6001600160a01b03841660009081526006602052604081204260028201558054839290611246908490611728565b9091555050506001600160a01b0390921660009081526006602052604090205492915050565b6001600160a01b03821661129657604051634b637e8f60e11b8152600060048201526024016101a8565b610f6782600083611418565b80515160009081906112bb906109e59061ffff166116fe565b90506000616cd784602001516000015161ffff166112d991906116fe565b905060006204ad3d85604001516000015161ffff166112f891906116fe565b905060006233719f86606001516000015161ffff1661131791906116fe565b905080826113258587611728565b61132f9190611728565b6113399190611728565b9695505050505050565b6001600160a01b03841661136d5760405163e602df0560e01b8152600060048201526024016101a8565b6001600160a01b03831661139757604051634a1406b160e11b8152600060048201526024016101a8565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610fe357826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161140a91815260200190565b60405180910390a350505050565b6001600160a01b0383166114435780600260008282546114389190611728565b909155506114b59050565b6001600160a01b038316600090815260208190526040902054818110156114965760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016101a8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166114d1576002805482900390556114f0565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161153591815260200190565b60405180910390a3505050565b602081526000825180602084015260005b818110156115705760208186018101516040868401015201611553565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146115a757600080fd5b919050565b600080604083850312156115bf57600080fd5b6115c883611590565b946020939093013593505050565b6000806000606084860312156115eb57600080fd5b6115f484611590565b925061160260208501611590565b929592945050506040919091013590565b60006020828403121561162557600080fd5b61162e82611590565b9392505050565b6000806040838503121561164857600080fd5b823560ff8116811461165957600080fd5b9150602083013561ffff8116811461167057600080fd5b809150509250929050565b6000806040838503121561168e57600080fd5b61169783611590565b91506116a560208401611590565b90509250929050565b600181811c908216806116c257607f821691505b6020821081036116e257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176106be576106be6116e8565b818103818111156106be576106be6116e8565b808201808211156106be576106be6116e8565b61ffff81811683821601908111156106be576106be6116e8565b60008261177257634e487b7160e01b600052601260045260246000fd5b50049056fea264697066735822122018883c7d03d56470fc81f70a3f832bb52067beeee47d599563ff6a39a1ae4ab464736f6c634300081c0033", + "nonce": "0x10", + "chainId": "0x14a34" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x3a7bc8", + "logs": [ + { + "address": "0xc912823b231f5d052ef334a8f8b73f6354909cd0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000003295cca2d922c637d35b258fc6c9c7e471803b45" + ], + "data": "0x", + "blockHash": "0x22810daaf13b97d44df0736c41e5791628109023b8fb727a2c297d20144e5b13", + "blockNumber": "0x106a666", + "transactionHash": "0xf2704113a36a9f99d71f06e9996046758b23a11e8ad4e599fc6aa2667369cbec", + "transactionIndex": "0x14", + "logIndex": "0x26", + "removed": false + } + ], + "logsBloom": "0x00000020000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000100000000000000020000000000000000000800000000000000000000000000000000400000000000001000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xf2704113a36a9f99d71f06e9996046758b23a11e8ad4e599fc6aa2667369cbec", + "transactionIndex": "0x14", + "blockHash": "0x22810daaf13b97d44df0736c41e5791628109023b8fb727a2c297d20144e5b13", + "blockNumber": "0x106a666", + "gasUsed": "0x15fb7c", + "effectiveGasPrice": "0xf4388", + "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", + "to": null, + "contractAddress": "0xc912823b231f5d052ef334a8f8b73f6354909cd0", + "l1BaseFeeScalar": "0x44d", + "l1BlobBaseFee": "0x1", + "l1BlobBaseFeeScalar": "0xa118b", + "l1Fee": "0x2a678c4ab6", + "l1GasPrice": "0xa1cc326d", + "l1GasUsed": "0xee0a" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1730194354, + "chain": 84532, + "commit": "504197e" +} \ No newline at end of file diff --git a/broadcast/RaidGeld.s.sol/84532/run-latest.json b/broadcast/RaidGeld.s.sol/84532/run-latest.json deleted file mode 100644 index 76fb6d9..0000000 --- a/broadcast/RaidGeld.s.sol/84532/run-latest.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "transactions": [ - { - "hash": "0xd4fa77c04f44634b166b7ae80cabe097cf35d8d38ea569e499b73310623501d9", - "transactionType": "CREATE", - "contractName": "RaidGeld", - "contractAddress": "0x3572a80eb8df722c98814290f86be29141859660", - "function": null, - "arguments": null, - "transaction": { - "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", - "gas": "0x1c9543", - "value": "0x0", - "input": "0x608060405234801561001057600080fd5b50336040518060400160405280600981526020016814985a590811d95b1960ba1b8152506040518060400160405280600481526020016311d1531160e21b8152508160039081610060919061019e565b50600461006d828261019e565b5050506001600160a01b03811661009e57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100a7816100ad565b5061025c565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061012957607f821691505b60208210810361014957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561019957806000526020600020601f840160051c810160208510156101765750805b601f840160051c820191505b818110156101965760008155600101610182565b50505b505050565b81516001600160401b038111156101b7576101b76100ff565b6101cb816101c58454610115565b8461014f565b6020601f8211600181146101ff57600083156101e75750848201515b600019600385901b1c1916600184901b178455610196565b600084815260208120601f198516915b8281101561022f578785015182556020948501946001909201910161020f565b508482101561024d5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6117b08061026b6000396000f3fe6080604052600436106101395760003560e01c806370a08231116100ab578063a7db742f1161006f578063a7db742f14610530578063a9059cbb14610545578063c3c5a54714610565578063c861dcb1146105a0578063dd62ed3e146105b5578063f2fde38b146105fb576101b1565b806370a0823114610488578063715018a6146104be57806385ed706d146104d35780638da5cb5b146104f357806395d89b411461051b576101b1565b806323b872dd116100fd57806323b872dd14610296578063313ce567146102b65780633ccfd60b146102d257806347d1e46e146102e757806353d7da60146103015780635c12cd4b14610446576101b1565b806306fdde03146101f9578063095ea7b31461022457806313820ba71461025457806318160ddd146102775780631aa3a0081461028c576101b1565b366101b15760405162461bcd60e51b815260206004820152603f60248201527f4e6f20706c61696e2045746865722061636365707465642c207573652072656760448201527f697374657228292066756e6374696f6e20746f20636865636b20696e203a290060648201526084015b60405180910390fd5b60405162461bcd60e51b815260206004820152601a60248201527f4e6f2066616c6c6261636b2063616c6c7320616363657074656400000000000060448201526064016101a8565b34801561020557600080fd5b5061020e61061b565b60405161021b91906113e6565b60405180910390f35b34801561023057600080fd5b5061024461023f366004611450565b6106ad565b604051901515815260200161021b565b34801561026057600080fd5b50610269600f81565b60405190815260200161021b565b34801561028357600080fd5b50600254610269565b6102946106c7565b005b3480156102a257600080fd5b506102446102b136600461147a565b6108ab565b3480156102c257600080fd5b506040516004815260200161021b565b3480156102de57600080fd5b506102946108cf565b3480156102f357600080fd5b50610269652d79883d200081565b34801561030d57600080fd5b506103f061031c3660046114b7565b6040805160c081018252600060a082018181528252825160208082018552828252808401919091528351808201855282815283850152835190810190935280835260608201929092526080810191909152506001600160a01b0316600090815260076020908152604091829020825160c081018452815461ffff90811660a08301908152825284518085018652600184015482168152828501528451808501865260028401548216815282860152845193840190945260038201549093168252606083019190915260040154608082015290565b60405161021b9190600060a08201905061ffff83515116825261ffff60208401515116602083015261ffff60408401515116604083015261ffff6060840151511660608301526080830151608083015292915050565b34801561045257600080fd5b506104666104613660046114b7565b610913565b604080518251815260208084015190820152918101519082015260600161021b565b34801561049457600080fd5b506102696104a33660046114b7565b6001600160a01b031660009081526020819052604090205490565b3480156104ca57600080fd5b50610294610979565b3480156104df57600080fd5b506102946104ee3660046114d9565b61098d565b3480156104ff57600080fd5b506005546040516001600160a01b03909116815260200161021b565b34801561052757600080fd5b5061020e610c83565b34801561053c57600080fd5b50610294610c92565b34801561055157600080fd5b50610244610560366004611450565b610d5d565b34801561057157600080fd5b506102446105803660046114b7565b6001600160a01b0316600090815260066020526040902060010154151590565b3480156105ac57600080fd5b50610269610d6b565b3480156105c157600080fd5b506102696105d036600461151f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561060757600080fd5b506102946106163660046114b7565b610d85565b60606003805461062a90611552565b80601f016020809104026020016040519081016040528092919081815260200182805461065690611552565b80156106a35780601f10610678576101008083540402835291602001916106a3565b820191906000526020600020905b81548152906001019060200180831161068657829003601f168201915b5050505050905090565b6000336106bb818585610dc0565b60019150505b92915050565b33600090815260066020526040902060010154156107275760405162461bcd60e51b815260206004820181905260248201527f57686f6f70732c20706c6179657220616c726561647920657869737473203a2960448201526064016101a8565b652d79883d2000341461077c5760405162461bcd60e51b815260206004820152601760248201527f496e636f72726563742062757920696e20616d6f756e7400000000000000000060448201526064016101a8565b61079c3361078c6004600a611689565b610797906032611698565b610dd2565b60405180606001604052806004600a6107b59190611689565b6107c0906032611698565b815242602080830182905260409283019190915233600081815260068352838120855181558584015160018083019190915595850151600291820155845160c08101865260a0810183815281528551808601875283815281860190815286518087018852848152828801908152875180880189528581526060840190815260808401868152968652600790975296909320905151815461ffff1990811661ffff92831617835593515197820180548516988216989098179097559451519085018054831691871691909117905591515160038401805490931694169390931790559051600490910155565b6000336108b9858285610e0c565b6108c4858585610e8a565b506001949350505050565b6108d7610ee9565b6005546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610910573d6000803e3d6000fd5b50565b61093760405180606001604052806000815260200160008152602001600081525090565b506001600160a01b0316600090815260066020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915290565b610981610ee9565b61098b6000610f16565b565b3360009081526006602052604081206001015490036109e85760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b60038260ff161115610a2b5760405162461bcd60e51b815260206004820152600c60248201526b155b9adb9bdddb881d5b9a5d60a21b60448201526064016101a8565b3360009081526007602052604081209060ff84168103610a515750805461ffff16610a9b565b8360ff16600103610a6b5750600181015461ffff16610a9b565b8360ff16600203610a855750600281015461ffff16610a9b565b8360ff16600303610a9b5750600381015461ffff165b6000610aa96004600a611689565b610ab4868487610f68565b610abe9190611698565b336000908152602081905260409020549091508110610b1f5760405162461bcd60e51b815260206004820181905260248201527f4e6f7420656e6f7567682047454c4420746f206164642074686973206d75636860448201526064016101a8565b610b2833611033565b610b3233826110cc565b8460ff16600003610b7457825484908490600090610b5590849061ffff166116af565b92506101000a81548161ffff021916908361ffff160217905550610c01565b8460ff16600103610b9a57600183018054859190600090610b5590849061ffff166116af565b8460ff16600203610bc057600283018054859190600090610b5590849061ffff166116af565b8460ff16600303610c0157600383018054859190600090610be690849061ffff166116af565b92506101000a81548161ffff021916908361ffff1602179055505b6040805160c081018252845461ffff90811660a08301908152825282516020818101855260018801548316825280840191909152835180820185526002880154831681528385015283519081019093526003860154168252606081019190915260048401546080820152610c7490611102565b83600401819055505050505050565b60606004805461062a90611552565b336000908152600660205260408120600101549003610ced5760405162461bcd60e51b81526020600482015260176024820152762737ba1030b71034b734ba34b0ba32b210383630bcb2b960491b60448201526064016101a8565b33600090815260066020526040902060020154610d0c90600f906116c9565b421015610d545760405162461bcd60e51b81526020600482015260166024820152752a3934b2b21036b4b73a34b733903a37b79039b7b7b760511b60448201526064016101a8565b61098b33611033565b6000336106bb818585610e8a565b610d776004600a611689565b610d82906032611698565b81565b610d8d610ee9565b6001600160a01b038116610db757604051631e4fbdf760e01b8152600060048201526024016101a8565b61091081610f16565b610dcd83838360016111e7565b505050565b6001600160a01b038216610dfc5760405163ec442f0560e01b8152600060048201526024016101a8565b610e08600083836112bc565b5050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610e845781811015610e7557604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016101a8565b610e84848484840360006111e7565b50505050565b6001600160a01b038316610eb457604051634b637e8f60e11b8152600060048201526024016101a8565b6001600160a01b038216610ede5760405163ec442f0560e01b8152600060048201526024016101a8565b610dcd8383836112bc565b6005546001600160a01b0316331461098b5760405163118cdaa760e01b81523360048201526024016101a8565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060038460ff161115610fb75760405162461bcd60e51b8152602060048201526016602482015275139bc81b585d18da1a5b99c81d5b9a5d08199bdd5b9960521b60448201526064016101a8565b6000610fc48560016116dc565b610fd29060ff166026611698565b905080607360015b610fe486886116af565b61ffff16811015611027576064610ffb8386611698565b611005919061170b565b93508661ffff16811061101f5761101c84846116c9565b92505b600101610fda565b50909695505050505050565b6001600160a01b038116600090815260066020526040812060020154611059904261171f565b905060006110696004600a611689565b6001600160a01b038416600090815260076020526040902060040154611090908490611698565b61109a9190611698565b90506110a68382610dd2565b6001600160a01b0390921660009081526006602052604090204260028201559190915550565b6001600160a01b0382166110f657604051634b637e8f60e11b8152600060048201526024016101a8565b610e08826000836112bc565b80515160208201515160009161ffff16908290600a9061112390603d611732565b61112d9190611756565b61ffff1690506000600a856040015160000151600661114c9190611732565b611157906040611732565b6111619190611756565b61ffff1690506000600a80600a886060015160000151603d6111839190611732565b61118d9190611756565b611198906040611732565b6111a29190611756565b6111ad906043611732565b6111b79190611756565b61ffff16905080826111c985876116c9565b6111d391906116c9565b6111dd91906116c9565b9695505050505050565b6001600160a01b0384166112115760405163e602df0560e01b8152600060048201526024016101a8565b6001600160a01b03831661123b57604051634a1406b160e11b8152600060048201526024016101a8565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610e8457826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516112ae91815260200190565b60405180910390a350505050565b6001600160a01b0383166112e75780600260008282546112dc91906116c9565b909155506113599050565b6001600160a01b0383166000908152602081905260409020548181101561133a5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016101a8565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661137557600280548290039055611394565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113d991815260200190565b60405180910390a3505050565b602081526000825180602084015260005b8181101561141457602081860181015160408684010152016113f7565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b038116811461144b57600080fd5b919050565b6000806040838503121561146357600080fd5b61146c83611434565b946020939093013593505050565b60008060006060848603121561148f57600080fd5b61149884611434565b92506114a660208501611434565b929592945050506040919091013590565b6000602082840312156114c957600080fd5b6114d282611434565b9392505050565b600080604083850312156114ec57600080fd5b823560ff811681146114fd57600080fd5b9150602083013561ffff8116811461151457600080fd5b809150509250929050565b6000806040838503121561153257600080fd5b61153b83611434565b915061154960208401611434565b90509250929050565b600181811c9082168061156657607f821691505b60208210810361158657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001815b60018411156115dd578085048111156115c1576115c161158c565b60018416156115cf57908102905b60019390931c9280026115a6565b935093915050565b6000826115f4575060016106c1565b81611601575060006106c1565b816001811461161757600281146116215761163d565b60019150506106c1565b60ff8411156116325761163261158c565b50506001821b6106c1565b5060208310610133831016604e8410600b8410161715611660575081810a6106c1565b61166d60001984846115a2565b80600019048211156116815761168161158c565b029392505050565b60006114d260ff8416836115e5565b80820281158282048414176106c1576106c161158c565b61ffff81811683821601908111156106c1576106c161158c565b808201808211156106c1576106c161158c565b60ff81811683821601908111156106c1576106c161158c565b634e487b7160e01b600052601260045260246000fd5b60008261171a5761171a6116f5565b500490565b818103818111156106c1576106c161158c565b61ffff818116838216029081169081811461174f5761174f61158c565b5092915050565b600061ffff83168061176a5761176a6116f5565b8061ffff8416049150509291505056fea2646970667358221220313cc1e5e86bbb7d3c3ded2bd7a034c1d5ffeb6733733567e3c8f6b4f041b55864736f6c634300081c0033", - "nonce": "0x7", - "chainId": "0x14a34" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "status": "0x1", - "cumulativeGasUsed": "0x1f8453", - "logs": [ - { - "address": "0x3572a80eb8df722c98814290f86be29141859660", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000003295cca2d922c637d35b258fc6c9c7e471803b45" - ], - "data": "0x", - "blockHash": "0x9708bb1125f0e43dc1ffc445a674ebbf03f5e0c95bf8f803027fe0b8a64492dd", - "blockNumber": "0x1037033", - "transactionHash": "0xd4fa77c04f44634b166b7ae80cabe097cf35d8d38ea569e499b73310623501d9", - "transactionIndex": "0x7", - "logIndex": "0x7", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000200000000000000800000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001000000000000000000000100000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x2", - "transactionHash": "0xd4fa77c04f44634b166b7ae80cabe097cf35d8d38ea569e499b73310623501d9", - "transactionIndex": "0x7", - "blockHash": "0x9708bb1125f0e43dc1ffc445a674ebbf03f5e0c95bf8f803027fe0b8a64492dd", - "blockNumber": "0x1037033", - "gasUsed": "0x15fe4c", - "effectiveGasPrice": "0x13b3f9", - "from": "0x3295cca2d922c637d35b258fc6c9c7e471803b45", - "to": null, - "contractAddress": "0x3572a80eb8df722c98814290f86be29141859660", - "l1BaseFeeScalar": "0x44d", - "l1BlobBaseFee": "0x1", - "l1BlobBaseFeeScalar": "0xa118b", - "l1Fee": "0x664fcff1ad", - "l1GasPrice": "0x17fe2ef41", - "l1GasUsed": "0xf211" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1729773387, - "chain": 84532, - "commit": "cb12c77" -} \ No newline at end of file diff --git a/deploy_contract.sh b/deploy_contract.sh index 8dc4b9a..667fc86 100755 --- a/deploy_contract.sh +++ b/deploy_contract.sh @@ -1,4 +1,23 @@ -#!/bin/sh -cast rpc anvil_setBalance 0x3295CCA2d922c637d35b258fc6c9C7e471803b45 0xDE0B6B3A7640000 --rpc-url http://127.0.0.1:8545 -forge script script/RaidGeld.s.sol:RaidGeldScript --rpc-url 127.0.0.1:8545 --broadcast --private-key $DEV_PRIVATE_KEY -cast rpc anvil_mine +#!/bin/bash + +# YOUR WALLET, change to you account below: +DEV_WALLET="0x3295CCA2d922c637d35b258fc6c9C7e471803b45" + +DAO_OWNER="0x4d5A5B4a679b10038e1677C84Cb675d10d29fFFD" +DAO_CONTRACT="0x11dC980faf34A1D082Ae8A6a883db3A950a3c6E8" + +# Set balance for the dev wallet (1eth) +cast rpc anvil_setBalance $DEV_WALLET 0xDE0B6B3A7640000 --rpc-url http://127.0.0.1:8545 +cast rpc anvil_setBalance $DAO_OWNER 0xDE0B6B3A7640000 --rpc-url http://127.0.0.1:8545 + +# Deploy RaidGeld +forge script script/RaidGeld.s.sol:RaidGeldScript --rpc-url http://127.0.0.1:8545 --broadcast --private-key $DEV_PRIVATE_KEY + +# Impersonate the DAO owner account +cast rpc anvil_impersonateAccount $DAO_OWNER + +# Send the mint transaction as the impersonated owner +cast send $DAO_CONTRACT "mint(address,uint256)" $DEV_WALLET 0x00000000000000000000000000000000000000000000003635c9adc5dea00000 --from $DAO_OWNER --rpc-url http://127.0.0.1:8545 --unlocked --gas-limit 300000 + +# Stop impersonating the DAO owner +cast rpc anvil_stopImpersonatingAccount $DAO_OWNER diff --git a/lib/forge-std b/lib/forge-std index 1eea5ba..8f24d6b 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 1eea5bae12ae557d589f9f0f0edae2faa47cb262 +Subproject commit 8f24d6b04c92975e0795b5868aa0d783251cdeaa diff --git a/script/RaidGeld.s.sol b/script/RaidGeld.s.sol index ea5f87c..1cce4ee 100644 --- a/script/RaidGeld.s.sol +++ b/script/RaidGeld.s.sol @@ -3,15 +3,16 @@ pragma solidity ^0.8.13; import {Script, console} from "forge-std/Script.sol"; import {RaidGeld} from "../src/RaidGeld.sol"; +import {Constants} from "../src/Constants.sol"; -contract RaidGeldScript is Script { +contract RaidGeldScript is Script, Constants { RaidGeld public raidgeld; function setUp() public {} function run() public { vm.startBroadcast(); - raidgeld = new RaidGeld(); + raidgeld = new RaidGeld(DAO_TOKEN, POOL); vm.stopBroadcast(); } } diff --git a/src/Constants.sol b/src/Constants.sol new file mode 100644 index 0000000..58237ff --- /dev/null +++ b/src/Constants.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.13; + +contract Constants { + //base addresses + address public constant DAO_TOKEN = 0x11dC980faf34A1D082Ae8A6a883db3A950a3c6E8; + address public constant POOL = 0x27004f6d0c1bB7979367D32Ba9d6DF6d61A18926; + address public constant WETH = 0x4200000000000000000000000000000000000006; + address public constant SWAP_ROUTER = 0x2626664c2603336E57B271c5C0b26F421741e481; +} diff --git a/src/RaidGeld.sol b/src/RaidGeld.sol index 5bb3e75..a592dd9 100644 --- a/src/RaidGeld.sol +++ b/src/RaidGeld.sol @@ -3,18 +3,27 @@ pragma solidity ^0.8.13; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; + import {RaidGeldUtils} from "../src/RaidGeldUtils.sol"; import {Army, Player, Raider} from "../src/RaidGeldStructs.sol"; +import "../src/Constants.sol"; -contract RaidGeld is ERC20, Ownable { +contract RaidGeld is ERC20, Ownable, Constants { uint256 public constant MANTISSA = 1e4; - uint256 public constant BUY_IN_AMOUNT = 0.00005 ether; - uint256 public constant INITIAL_GELD = 50 * MANTISSA; - + uint256 public immutable BUY_IN_DAO_TOKEN_AMOUNT; + uint256 public constant INITIAL_GELD = 500 * MANTISSA; mapping(address => Player) private players; mapping(address => Army) private armies; + // WETH + IWETH public immutable weth = IWETH(WETH); + // RGCVII token + ERC20 public daoToken; + // RGCVII pool + address public pool; + // Uniswap + ISwapRouter02 private constant router = ISwapRouter02(SWAP_ROUTER); // Events event PlayerRegistered(address indexed player, uint256 initialGeld); event RaidPerformed( @@ -40,19 +49,20 @@ contract RaidGeld is ERC20, Ownable { _; } - constructor() ERC20("Raid Geld", "GELD") Ownable(msg.sender) {} + modifier newPlayer() { + require(players[msg.sender].created_at == 0, "Whoops, player already exists :)"); + _; + } - // This effectively registers the user - function register() external payable { - require( - players[msg.sender].created_at == 0, - "Whoops, player already exists :)" - ); - require(msg.value == BUY_IN_AMOUNT, "Incorrect buy in amount"); + constructor(address _daoToken, address _pool) ERC20("Raid Geld", "GELD") Ownable(msg.sender) { + daoToken = ERC20(_daoToken); + pool = _pool; + BUY_IN_DAO_TOKEN_AMOUNT = 50 * 10 ** daoToken.decimals(); + } + function init_player(address player) private { // Mint some starting tokens to the player - _mint(msg.sender, INITIAL_GELD); - + _mint(player, INITIAL_GELD); // Set initial states players[msg.sender] = Player({ total_minted: INITIAL_GELD, @@ -71,14 +81,44 @@ contract RaidGeld is ERC20, Ownable { emit PlayerRegistered(msg.sender, INITIAL_GELD); } + // New player want to register with ETH + function register_eth() external payable newPlayer { + require(msg.value == BUY_IN_AMOUNT, "Incorrect buy in amount"); + weth.deposit{value: BUY_IN_AMOUNT}(); + weth.approve(address(router), BUY_IN_AMOUNT); + ISwapRouter02.ExactInputSingleParams memory params = ISwapRouter02.ExactInputSingleParams({ + tokenIn: WETH, + tokenOut: DAO_TOKEN, + fee: 10000, + recipient: address(this), + amountIn: BUY_IN_AMOUNT, + amountOutMinimum: 0, + sqrtPriceLimitX96: 0 + }); + router.exactInputSingle(params); + init_player(msg.sender); + } + + // New player wants to register with dao + function register_dao() external payable newPlayer { + //@notice this is not safe for arbitrary tokens, which may not follow the interface eg. USDT + //@notice but should be fine for the DAO token + require( + daoToken.transferFrom(msg.sender, address(this), BUY_IN_DAO_TOKEN_AMOUNT), "Failed to transfer DAO tokens" + ); + // Init player + init_player(msg.sender); + } + // Override for default number of decimals function decimals() public view virtual override returns (uint8) { return 4; } - // Allows the owner to withdraw + // Allows the owner to withdraw DAO tokens function withdraw() external onlyOwner { - payable(owner()).transfer(address(this).balance); + uint256 amount = daoToken.balanceOf(address(this)); + daoToken.transfer(owner(), amount); } // Manual minting for itchy fingers @@ -206,3 +246,40 @@ contract RaidGeld is ERC20, Ownable { revert("No fallback calls accepted"); } } + +interface ISwapRouter02 { + struct ExactInputSingleParams { + address tokenIn; + address tokenOut; + uint24 fee; + address recipient; + uint256 amountIn; + uint256 amountOutMinimum; + uint160 sqrtPriceLimitX96; + } + + function exactInputSingle(ExactInputSingleParams calldata params) + external + payable + returns (uint256 amountOut); + + struct ExactOutputSingleParams { + address tokenIn; + address tokenOut; + uint24 fee; + address recipient; + uint256 amountOut; + uint256 amountInMaximum; + uint160 sqrtPriceLimitX96; + } + + function exactOutputSingle(ExactOutputSingleParams calldata params) + external + payable + returns (uint256 amountIn); +} + +interface IWETH is IERC20 { + function deposit() external payable; + function withdraw(uint256 amount) external; +} diff --git a/test/RaidGeld.t.sol b/test/RaidGeld.t.sol index b741884..300acc6 100644 --- a/test/RaidGeld.t.sol +++ b/test/RaidGeld.t.sol @@ -2,15 +2,20 @@ pragma solidity ^0.8.13; import {Test, console} from "forge-std/Test.sol"; +import {stdStorage, StdStorage} from "forge-std/Test.sol"; import {RaidGeld, Army, Player} from "../src/RaidGeld.sol"; import "../src/RaidGeldUtils.sol"; +import {Constants} from "../src/Constants.sol"; + +contract raid_geldTest is Test, Constants { + using stdStorage for StdStorage; -contract raid_geldTest is Test { RaidGeld public raid_geld; address public player1; address public player2; address public owner; + event Approval(address indexed owner, address indexed spender, uint256 value); event PlayerRegistered(address indexed player, uint256 initialGeld); event RaidPerformed( address indexed player, @@ -33,13 +38,24 @@ contract raid_geldTest is Test { owner = address(0x126); player1 = address(0x123); vm.deal(owner, 10 ether); - vm.deal(player1, 10 ether); + fundAccount(player1); vm.prank(owner); - raid_geld = new RaidGeld(); + raid_geld = new RaidGeld(DAO_TOKEN, POOL); + raid_geld.weth().deposit{value: 5 ether}(); + } + + function fundAccount(address _acc) private { + vm.deal(_acc, 10 ether); + stdstore.target(DAO_TOKEN).sig("balanceOf(address)").with_key(_acc).checked_write(100 ether); } function registerPlayer() private { - raid_geld.register{value: raid_geld.BUY_IN_AMOUNT()}(); + raid_geld.register_eth{value: raid_geld.BUY_IN_AMOUNT()}(); + } + + function registerPlayerWithDaoToken() private { + raid_geld.daoToken().approve(address(raid_geld), raid_geld.BUY_IN_DAO_TOKEN_AMOUNT()); + raid_geld.register_dao(); } function test_00_no_fallback() public { @@ -54,27 +70,28 @@ contract raid_geldTest is Test { payable(address(raid_geld)).transfer(0.1 ether); } - function test_02_registration() public { + function test_02_1_registrationWithEth() public { vm.startPrank(player1); - uint256 initialBalance = address(raid_geld).balance; + uint256 contractBalance = raid_geld.daoToken().balanceOf(address(raid_geld)); + uint256 userBalance = address(player1).balance; // Making sure event is emitted when player is registered vm.expectEmit(address(raid_geld)); - emit PlayerRegistered(player1, raid_geld.INITIAL_GELD()); - - // Send registration fee ETH to the contract registerPlayer(); // Check that initialraid_geld.is received by the player assertEq(raid_geld.balanceOf(player1), raid_geld.INITIAL_GELD()); // Verify the contract balance is updated - assertEq( - address(raid_geld).balance, - initialBalance + raid_geld.BUY_IN_AMOUNT() - ); + uint256 contractBalance2 = raid_geld.daoToken().balanceOf(address(raid_geld)); + uint256 userBalance2 = address(player1).balance; + + // Contract should get DAO tokens + assertLt(contractBalance, contractBalance2); + // Player should lose ETH + assertEq(userBalance2, userBalance - raid_geld.BUY_IN_AMOUNT()); // Verify player is set initially Player memory player = raid_geld.getPlayer(player1); @@ -90,40 +107,61 @@ contract raid_geldTest is Test { assertEq(army.champion.level, 0); } - function test_03_funds_can_be_withdrawn() public { - uint256 initialBalance = owner.balance; + function test_02_2_registrationWithDaoToken() public { + vm.startPrank(player1); + + uint256 initialBalance = raid_geld.daoToken().balanceOf(address(raid_geld)); + + // Making sure event is emitted when player is registered + // doesnt test player emitted event because other events get emitted before it + registerPlayerWithDaoToken(); + + // Check that initial raid_geld is received by the player + assertEq(raid_geld.balanceOf(player1), raid_geld.INITIAL_GELD()); + + // Verify the contract dao token balance is updated + assertEq( + raid_geld.daoToken().balanceOf(address(raid_geld)), initialBalance + raid_geld.BUY_IN_DAO_TOKEN_AMOUNT() + ); + + // Verify player is set initially + Player memory player = raid_geld.getPlayer(player1); + assertEq(player.total_minted, raid_geld.INITIAL_GELD()); + assertEq(player.created_at, block.timestamp); + assertEq(player.last_raided_at, block.timestamp); + + Army memory army = raid_geld.getArmy(player1); + + assertEq(army.moloch_denier.level, 0); + assertEq(army.apprentice.level, 0); + assertEq(army.anointed.level, 0); + assertEq(army.champion.level, 0); + } + + function test_03_dao_token_can_be_withdrawn() public { + uint256 initialBalance = raid_geld.daoToken().balanceOf(address(raid_geld)); // Switch to Player 1 and register it vm.startPrank(player1); - // Making sure event is emitted when player is registered - vm.expectEmit(address(raid_geld)); - - emit PlayerRegistered(player1, raid_geld.INITIAL_GELD()); - - registerPlayer(); + // doesnt test player emitted event because other events get emitted before it + registerPlayerWithDaoToken(); // Switch back to owner and withdraw funds vm.startPrank(owner); raid_geld.withdraw(); - uint256 newBalance = owner.balance; - uint256 newContractBalance = address(raid_geld).balance; + uint256 newBalance = raid_geld.daoToken().balanceOf(address(owner)); + uint256 newContractBalance = raid_geld.daoToken().balanceOf(address(raid_geld)); // contract balance should be empty assertEq(newContractBalance, 0); // owner should have the extra funds - assertEq(newBalance, initialBalance + raid_geld.BUY_IN_AMOUNT()); + assertGt(newBalance, initialBalance); } function test_04_only_owner_can_withdraw() public { // Register player 1 vm.startPrank(player1); - - // Making sure event is emitted when player is registered - vm.expectEmit(address(raid_geld)); - - emit PlayerRegistered(player1, raid_geld.INITIAL_GELD()); - registerPlayer(); // attempt to withdraw with player 1, it should fail @@ -138,7 +176,6 @@ contract raid_geldTest is Test { // Making sure event is emitted when player is registered vm.expectEmit(address(raid_geld)); - emit PlayerRegistered(player1, raid_geld.INITIAL_GELD()); registerPlayer(); @@ -151,7 +188,6 @@ contract raid_geldTest is Test { // Making sure event is emitted when player is registered vm.expectEmit(address(raid_geld)); - emit PlayerRegistered(player1, raid_geld.INITIAL_GELD()); registerPlayer(); diff --git a/test/RaidGeldUtils.t.sol b/test/RaidGeldUtils.t.sol index 58ee5a5..5658e60 100644 --- a/test/RaidGeldUtils.t.sol +++ b/test/RaidGeldUtils.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.13; import {Test, console} from "forge-std/Test.sol"; -import {Army, Raider} from "../src/RaidGeld.sol"; +import {Army, Raider} from "../src/RaidGeldStructs.sol"; import "../src/RaidGeldUtils.sol"; contract raid_geldTest is Test {