├── .github └── workflows │ └── test.yml ├── .gitignore ├── .gitmodules ├── Makefile ├── README.md ├── broadcast ├── DeployBemPresale.s.sol │ └── 11155111 │ │ ├── run-1707875227.json │ │ ├── run-1707875234.json │ │ ├── run-1707875835.json │ │ ├── run-1707875851.json │ │ ├── run-1707897913.json │ │ ├── run-1707897927.json │ │ ├── run-1707920505.json │ │ ├── run-1707920525.json │ │ └── run-latest.json ├── DeployBemStaking.s.sol │ └── 11155111 │ │ ├── run-1707875924.json │ │ ├── run-1707875933.json │ │ ├── run-1707897991.json │ │ ├── run-1707897999.json │ │ ├── run-1707920604.json │ │ ├── run-1707920617.json │ │ └── run-latest.json ├── DeployBemToken.s.sol │ └── 11155111 │ │ ├── run-1707875183.json │ │ ├── run-1707875196.json │ │ ├── run-1707875796.json │ │ ├── run-1707875809.json │ │ ├── run-1707897884.json │ │ ├── run-1707897891.json │ │ ├── run-1707920469.json │ │ ├── run-1707920476.json │ │ └── run-latest.json └── DeployBemVesting.s.sol │ └── 11155111 │ ├── run-1707875876.json │ ├── run-1707875897.json │ ├── run-1707897949.json │ ├── run-1707897963.json │ ├── run-1707920559.json │ ├── run-1707920574.json │ └── run-latest.json ├── foundry.toml ├── metadata.json ├── script ├── DeployBemStaking.s.sol ├── DeployBemVesting.s.sol ├── deployBemPresale.s.sol └── deployBemToken.s.sol ├── src ├── AnotherStakingContract.sol ├── Bem.sol ├── BemPresale.sol ├── BemStaking.sol ├── BemTokenVesting.sol └── lib │ ├── ABDKMath64x64.sol │ └── FullMath.sol └── test ├── BemStakingTest.sol ├── BemVestingTest.t.sol └── BremPresaleTest.t.sol /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: workflow_dispatch 4 | 5 | env: 6 | FOUNDRY_PROFILE: ci 7 | 8 | jobs: 9 | check: 10 | strategy: 11 | fail-fast: true 12 | 13 | name: Foundry project 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | submodules: recursive 19 | 20 | - name: Install Foundry 21 | uses: foundry-rs/foundry-toolchain@v1 22 | with: 23 | version: nightly 24 | 25 | - name: Run Forge build 26 | run: | 27 | forge --version 28 | forge build --sizes 29 | id: build 30 | 31 | - name: Run Forge tests 32 | run: | 33 | forge test -vvv 34 | id: test 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiler files 2 | cache/ 3 | out/ 4 | 5 | # Ignores development broadcast logs 6 | !/broadcast 7 | /broadcast/*/31337/ 8 | /broadcast/**/dry-run/ 9 | 10 | # Docs 11 | docs/ 12 | 13 | # Dotenv file 14 | .env 15 | 16 | ##temperory contract 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/openzeppelin-contracts"] 5 | path = lib/openzeppelin-contracts 6 | url = https://github.com/OpenZeppelin/openzeppelin-contracts 7 | [submodule "lib/foundry-chainlink-toolkit"] 8 | path = lib/foundry-chainlink-toolkit 9 | url = https://github.com/smartcontractkit/foundry-chainlink-toolkit 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | -include .env 2 | 3 | .PHONY: all test clean deploy fund help install snapshot format anvil 4 | 5 | DEFAULT_KEY := fbf992b0e25ad29c85aae3d69fcb7f09240dd2588ecee449a4934b9e499102cc 6 | 7 | help: 8 | @echo "Usage:" 9 | @echo " make deploy [ARGS=...]\n example: make deploy ARGS=\"--network sepolia\"" 10 | @echo "" 11 | @echo " make fund [ARGS=...]\n example: make deploy ARGS=\"--network sepolia\"" 12 | 13 | all: clean remove install update build 14 | 15 | # Clean the repo 16 | clean :; forge clean 17 | 18 | # Remove modules 19 | remove :; rm -rf .gitmodules && rm -rf .git/modules/* && rm -rf lib && touch .gitmodules && git add . && git commit -m "modules" 20 | 21 | install :; forge install Cyfrin/foundry-devops@0.0.11 --no-commit --no-commit && forge install foundry-rs/forge-std@v1.5.3 --no-commit && forge install openzeppelin/openzeppelin-contracts@v4.8.3 --no-commit 22 | 23 | # Update Dependencies 24 | update:; forge update 25 | 26 | build:; forge build 27 | 28 | test :; forge test 29 | 30 | snapshot :; forge snapshot 31 | 32 | format :; forge fmt 33 | 34 | anvil :; anvil -m 'test test test test test test test test test test test junk' --steps-tracing --block-time 1 35 | 36 | NETWORK_ARGS := --rpc-url https://eth-sepolia.g.alchemy.com/v2/fWr3m1Bq4Mqxz0n-WoE86aq24VsXTsrq --private-key $(DEFAULT_KEY) --broadcast 37 | 38 | ifeq ($(findstring --network sepolia,$(ARGS)),--network sepolia) 39 | NETWORK_ARGS := --rpc-url $(ALCHEMY_RPC_URL) --private-key $(METAMASK_PRIVATE_KEY) --broadcast --verify --etherscan-api-key $(ETHERSCAN_API_KEY) -vvvv 40 | endif 41 | 42 | deploy: 43 | @forge script script/DeployBemToken.s.sol:DeployBemToken $(NETWORK_ARGS) 44 | @forge script script/DeployBemPresale.s.sol:DeployBemPresale $(NETWORK_ARGS) 45 | @forge script script/DeployBemVesting.s.sol:DeployBemVesting $(NETWORK_ARGS) 46 | @forge script script/DeployBemStaking.s.sol:DeployBemStaking $(NETWORK_ARGS) 47 | 48 | # cast abi-encode "constructor(uint256)" 1000000000000000000000000 -> 0x00000000000000000000000000000000000000000000d3c21bcecceda1000000 49 | # Update with your contract address, constructor arguments and anything else 50 | verify: 51 | @forge verify-contract --chain-id 11155111 --num-of-optimizations 200 --watch --etherscan-api-key $(ETHERSCAN_API_KEY) --compiler-version 0.8.21+commit.d9974bed 0x38bf30a1F7B528A3f1261f41B2843451CD8574D9 src/Bem.sol:BemToken 52 | @forge verify-contract --chain-id 11155111 --num-of-optimizations 200 --watch --constructor-args 0x0000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000001c6bf52634000000000000000000000000000000000000000000000000000001ff973cafa800000000000000000000000000038bf30a1f7b528a3f1261f41b2843451cd8574d93a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae --etherscan-api-key $(ETHERSCAN_API_KEY) --compiler-version 0.8.21+commit.d9974bed 0xCB20B79194d3dEeB88df2Dc236adbC93aEf8622a src/BemPresale.sol:BemPresale 53 | @forge verify-contract --chain-id 11155111 --num-of-optimizations 200 --watch --constructor-args 0x00000000000000000000000038bf30a1f7b528a3f1261f41b2843451cd8574d9876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee --etherscan-api-key $(ETHERSCAN_API_KEY) --compiler-version 0.8.21+commit.d9974bed 0xfDd00E9377e8121F72A4fe760Bb77f05d838EbF0 src/BemTokenVesting.sol:PresaleTokenVesting 54 | @forge verify-contract --chain-id 11155111 --num-of-optimizations 200 --watch --constructor-args 0x00000000000000000000000038bf30a1f7b528a3f1261f41b2843451cd8574d9000000000000000000000000e6f3889c8ebb361fa914ee78fa4e55b1bbed3a96000000000000000000000000000000000000000000000000000000000000000a --etherscan-api-key $(ETHERSCAN_API_KEY) --compiler-version 0.8.21+commit.d9974bed 0xC1D69935301b96A5159BD0c88987f1C93aFB7F28 src/BemStaking.sol:BemStaking 55 | 56 | 57 | #https://sepolia.etherscan.io/address/0x63ab7157810af3386491b4efbff79bed0aae41da -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## BemToken & ERC20StakingPool Project 2 | 3 | **Overview:** 4 | This project consists of a suite of smart contracts designed for the BemToken ecosystem, focusing on ERC20 token functionalities including dynamic emission, token vesting, and a staking pool for rewarding ERC20 stakers with ERC20 tokens periodically and continuously. The core contracts in this project are BemToken, which implements an ERC20 token with additional features such as dynamic emission and airdrops, and ERC20StakingPool, a modern, gas-optimized staking contract for rewarding token stakers. 5 | 6 | ## Features: 7 | 8 | **BemToken Contract:** Implements an ERC20 token with functionalities like initial minting, monthly token burn, external transfers, and claimable airdrops using Merkle Proofs. 9 | 10 | **Dynamic Emission:** Adjusts the token emission rate based on external inputs or predefined logic to ensure flexible token supply management. 11 | 12 | **Token Vesting:** Allows setting up vesting schedules for tokens to be distributed over a predefined period, enhancing token distribution security and predictability. 13 | 14 | **ERC20 Staking Pool:** Enables token holders to stake their tokens to earn rewards over time, with features to stake, withdraw, and claim rewards seamlessly. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ## Foundry 24 | 25 | **Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** 26 | 27 | 28 | 29 | ## Documentation 30 | 31 | https://book.getfoundry.sh/ 32 | 33 | ## Usage 34 | 35 | ### Build 36 | 37 | ```shell 38 | $ forge build 39 | ``` 40 | 41 | ### Test 42 | 43 | ```shell 44 | $ forge test 45 | ``` 46 | 47 | ### Format 48 | 49 | ```shell 50 | $ forge fmt 51 | ``` 52 | 53 | ### Gas Snapshots 54 | 55 | ```shell 56 | $ forge snapshot 57 | ``` 58 | 59 | ### Anvil 60 | 61 | ```shell 62 | $ anvil 63 | ``` 64 | ### Cast 65 | 66 | ```shell 67 | $ cast 68 | ``` 69 | 70 | ### Help 71 | 72 | ```shell 73 | $ forge --help 74 | $ anvil --help 75 | $ cast --help 76 | ``` 77 | -------------------------------------------------------------------------------- /broadcast/DeployBemPresale.s.sol/11155111/run-1707875227.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x264a05714f1f1355ce6bab3679cc5d28d9a853870493c8f9072d2deb5302f2db", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x5692A875EA2F769Bf20809Dd7DcFF14aefD82157", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x95", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | }, 22 | { 23 | "hash": "0x9e4f5c4d5b73da4996102ddca6ad168962d584d53e3978fc5c51fb9b8ca3eaad", 24 | "transactionType": "CREATE", 25 | "contractName": "BemPresale", 26 | "contractAddress": "0xC129124eA2Fd4D63C1Fc64059456D8f231eBbed1", 27 | "function": null, 28 | "arguments": [ 29 | "10000000000000000000", 30 | "500000000000000", 31 | "9000000000000000", 32 | "0x5692A875EA2F769Bf20809Dd7DcFF14aefD82157", 33 | "0x3a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae" 34 | ], 35 | "transaction": { 36 | "type": "0x02", 37 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 38 | "gas": "0x11f526", 39 | "value": "0x0", 40 | "data": "0x61012060405234801561001157600080fd5b506040516110b63803806110b68339810160408190526100309161016c565b338061005657604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005f8161011c565b50600085116100815760405163212ec15960e11b815260040160405180910390fd5b82158061008c575082155b156100aa57604051635ed468d760e01b815260040160405180910390fd5b6001600160a01b0382166100d15760405163070c64fd60e11b815260040160405180910390fd5b600180546001600160a81b0319167401694aa1769357215de4fac081bf1f309adc32530617905560a05260c09390935260e091909152610100526001600160a01b03166080526101c7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600060a0868803121561018457600080fd5b855160208701516040880151606089015192975090955093506001600160a01b03811681146101b257600080fd5b80925050608086015190509295509295909350565b60805160a05160c05160e05161010051610e7a61023c600039600081816102c9015281816103ef0152610457015260008181610331015261042e0152600081816101bf015261049c0152600081816102fd01526108e40152600081816106360152818161083901526109580152610e7a6000f3fe6080604052600436106101145760003560e01c806360d938dc116100a0578063d810a68d11610064578063d810a68d1461031f578063e5ff767414610353578063eb1c66c514610368578063f2fde38b1461037d578063f9e446071461039d57600080fd5b806360d938dc14610249578063715018a61461027a5780638da5cb5b1461028f578063c439f77b146102b7578063c73b959b146102eb57600080fd5b8063117df088116100e7578063117df08814610198578063171ee2b4146101ad5780632049d7a1146101e1578063290548f1146102015780635249be251461022e57600080fd5b80630269d3b41461011957806306b091f914610123578063070f5c09146101435780630d5d476714610158575b600080fd5b6101216103b3565b005b34801561012f57600080fd5b5061012161013e366004610c56565b6105bc565b34801561014f57600080fd5b506101216106ea565b34801561016457600080fd5b50610185610173366004610c80565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101a457600080fd5b50610121610701565b3480156101b957600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156101ed57600080fd5b506101216101fc366004610c9b565b610779565b34801561020d57600080fd5b5061018561021c366004610c80565b60036020526000908152604090205481565b34801561023a57600080fd5b50610185661aa535d3d0c00081565b34801561025557600080fd5b5060015461026a90600160a01b900460ff1681565b604051901515815260200161018f565b34801561028657600080fd5b50610121610a32565b34801561029b57600080fd5b506000546040516001600160a01b03909116815260200161018f565b3480156102c357600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156102f757600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b34801561032b57600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b34801561035f57600080fd5b50610121610a46565b34801561037457600080fd5b50610185610a63565b34801561038957600080fd5b50610121610398366004610c80565b610ae8565b3480156103a957600080fd5b5061018560025481565b600154600160a01b900460ff166103dd5760405163294e8f4960e01b815260040160405180910390fd5b336000908152600460205260409020547f00000000000000000000000000000000000000000000000000000000000000001161042c576040516302afb7e560e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000034108061047957507f000000000000000000000000000000000000000000000000000000000000000034115b1561049757604051636c8dabcd60e01b815260040160405180910390fd5b6002547f0000000000000000000000000000000000000000000000000000000000000000036104d95760405163994a405560e01b815260040160405180910390fd5b3460006104e4610a63565b90506000670de0b6b3a76400006104fb8385610d3d565b6105059190610d54565b336000908152600360205260408120859055909150661aa535d3d0c00061053483670de0b6b3a7640000610d3d565b61053e9190610d54565b905083600260008282546105529190610d76565b90915550503360009081526004602052604081208054839290610576908490610d76565b9091555050604080513481526020810183905233917f92258e94db53773befc080125cd404b8a9e5f229599a5c3c3123e83b15107ff1910160405180910390a250505050565b6105c4610b26565b600081116106105760405162461bcd60e51b81526020600482015260146024820152730416d6f756e742073686f756c64206265203e20360641b60448201526064015b60405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561067f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a39190610d89565b50604080516001600160a01b0384168152602081018390527f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b910160405180910390a15050565b6106f2610b26565b6001805460ff60a01b19169055565b610709610b26565b6000471161072a5760405163712c54b360e01b815260040160405180910390fd5b4761073d6000546001600160a01b031690565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610775573d6000803e3d6000fd5b5050565b610781610b26565b6001600160a01b0382166107a85760405163382de3c960e21b815260040160405180910390fd5b600081116107c9576040516364e3d0bd60e11b815260040160405180910390fd5b604080516001600160a01b038416602082015290810182905260009060600160408051601f198184030181528282528051602091820120908301520160408051808303601f1901815290829052805160209091012063095ea7b360e01b82523060048301526024820184905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063095ea7b3906044016020604051808303816000875af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190610d89565b5061090f8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f00000000000000000000000000000000000000000000000000000000000000009250859150610b539050565b61092c57604051630adf3c7b60e31b815260040160405180910390fd5b6040516323b872dd60e01b81523060048201526001600160a01b038481166024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af11580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c59190610d89565b6109e25760405163175decfb60e31b815260040160405180910390fd5b604080513081526001600160a01b03851660208201529081018390527f44347b1aec7858b9ab924df67243a402f4afd5e7d5f045176cde4c521350b88b9060600160405180910390a15050505050565b610a3a610b26565b610a446000610b69565b565b610a4e610b26565b6001805460ff60a01b1916600160a01b179055565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610add9190610dc5565b509195945050505050565b610af0610b26565b6001600160a01b038116610b1a57604051631e4fbdf760e01b815260006004820152602401610607565b610b2381610b69565b50565b6000546001600160a01b03163314610a445760405163118cdaa760e01b8152336004820152602401610607565b600082610b608584610bb9565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b8451811015610bfe57610bea82868381518110610bdd57610bdd610e15565b6020026020010151610c08565b915080610bf681610e2b565b915050610bbe565b5090505b92915050565b6000818310610c24576000828152602084905260409020610c33565b60008381526020839052604090205b9392505050565b80356001600160a01b0381168114610c5157600080fd5b919050565b60008060408385031215610c6957600080fd5b610c7283610c3a565b946020939093013593505050565b600060208284031215610c9257600080fd5b610c3382610c3a565b60008060008060608587031215610cb157600080fd5b843567ffffffffffffffff80821115610cc957600080fd5b818701915087601f830112610cdd57600080fd5b813581811115610cec57600080fd5b8860208260051b8501011115610d0157600080fd5b602092830196509450610d179187019050610c3a565b9396929550929360400135925050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610c0257610c02610d27565b600082610d7157634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610c0257610c02610d27565b600060208284031215610d9b57600080fd5b81518015158114610c3357600080fd5b805169ffffffffffffffffffff81168114610c5157600080fd5b600080600080600060a08688031215610ddd57600080fd5b610de686610dab565b9450602086015193506040860151925060608601519150610e0960808701610dab565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b600060018201610e3d57610e3d610d27565b506001019056fea26469706673582212205c58d6756a78f2c04d6e944d51995bb898d4dbb5a794e14d78f0d74af7b1c0d064736f6c634300081500330000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000001c6bf52634000000000000000000000000000000000000000000000000000001ff973cafa80000000000000000000000000005692a875ea2f769bf20809dd7dcff14aefd821573a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae", 41 | "nonce": "0x96", 42 | "accessList": [] 43 | }, 44 | "additionalContracts": [], 45 | "isFixedGasLimit": false 46 | } 47 | ], 48 | "receipts": [], 49 | "libraries": [], 50 | "pending": [ 51 | "0x264a05714f1f1355ce6bab3679cc5d28d9a853870493c8f9072d2deb5302f2db", 52 | "0x9e4f5c4d5b73da4996102ddca6ad168962d584d53e3978fc5c51fb9b8ca3eaad" 53 | ], 54 | "returns": { 55 | "0": { 56 | "internal_type": "contract BemPresale", 57 | "value": "0xC129124eA2Fd4D63C1Fc64059456D8f231eBbed1" 58 | } 59 | }, 60 | "timestamp": 1707875227, 61 | "chain": 11155111, 62 | "multi": false, 63 | "commit": "1740039" 64 | } -------------------------------------------------------------------------------- /broadcast/DeployBemPresale.s.sol/11155111/run-1707875835.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0xa1b4db4b68a955206a00aa1b1edf829ef7881ddbc9a11c8389e89c5dda71c144", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x09321aAA131cAA9B4E345bEAE92D00B716EFCF54", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x98", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | }, 22 | { 23 | "hash": "0x79167beb47a0dba394e56a43277a8feb215834d33d55e115a70e9fa97d0f534e", 24 | "transactionType": "CREATE", 25 | "contractName": "BemPresale", 26 | "contractAddress": "0x07C88116a4c89D4E8Afea7d567fD0c7c0F798F2C", 27 | "function": null, 28 | "arguments": [ 29 | "10000000000000000000", 30 | "500000000000000", 31 | "9000000000000000", 32 | "0x09321aAA131cAA9B4E345bEAE92D00B716EFCF54", 33 | "0x3a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae" 34 | ], 35 | "transaction": { 36 | "type": "0x02", 37 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 38 | "gas": "0x11f516", 39 | "value": "0x0", 40 | "data": "0x61012060405234801561001157600080fd5b506040516110b63803806110b68339810160408190526100309161016c565b338061005657604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005f8161011c565b50600085116100815760405163212ec15960e11b815260040160405180910390fd5b82158061008c575082155b156100aa57604051635ed468d760e01b815260040160405180910390fd5b6001600160a01b0382166100d15760405163070c64fd60e11b815260040160405180910390fd5b600180546001600160a81b0319167401694aa1769357215de4fac081bf1f309adc32530617905560a05260c09390935260e091909152610100526001600160a01b03166080526101c7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600060a0868803121561018457600080fd5b855160208701516040880151606089015192975090955093506001600160a01b03811681146101b257600080fd5b80925050608086015190509295509295909350565b60805160a05160c05160e05161010051610e7a61023c600039600081816102c9015281816103ef0152610457015260008181610331015261042e0152600081816101bf015261049c0152600081816102fd01526108e40152600081816106360152818161083901526109580152610e7a6000f3fe6080604052600436106101145760003560e01c806360d938dc116100a0578063d810a68d11610064578063d810a68d1461031f578063e5ff767414610353578063eb1c66c514610368578063f2fde38b1461037d578063f9e446071461039d57600080fd5b806360d938dc14610249578063715018a61461027a5780638da5cb5b1461028f578063c439f77b146102b7578063c73b959b146102eb57600080fd5b8063117df088116100e7578063117df08814610198578063171ee2b4146101ad5780632049d7a1146101e1578063290548f1146102015780635249be251461022e57600080fd5b80630269d3b41461011957806306b091f914610123578063070f5c09146101435780630d5d476714610158575b600080fd5b6101216103b3565b005b34801561012f57600080fd5b5061012161013e366004610c56565b6105bc565b34801561014f57600080fd5b506101216106ea565b34801561016457600080fd5b50610185610173366004610c80565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101a457600080fd5b50610121610701565b3480156101b957600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156101ed57600080fd5b506101216101fc366004610c9b565b610779565b34801561020d57600080fd5b5061018561021c366004610c80565b60036020526000908152604090205481565b34801561023a57600080fd5b50610185661aa535d3d0c00081565b34801561025557600080fd5b5060015461026a90600160a01b900460ff1681565b604051901515815260200161018f565b34801561028657600080fd5b50610121610a32565b34801561029b57600080fd5b506000546040516001600160a01b03909116815260200161018f565b3480156102c357600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b3480156102f757600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b34801561032b57600080fd5b506101857f000000000000000000000000000000000000000000000000000000000000000081565b34801561035f57600080fd5b50610121610a46565b34801561037457600080fd5b50610185610a63565b34801561038957600080fd5b50610121610398366004610c80565b610ae8565b3480156103a957600080fd5b5061018560025481565b600154600160a01b900460ff166103dd5760405163294e8f4960e01b815260040160405180910390fd5b336000908152600460205260409020547f00000000000000000000000000000000000000000000000000000000000000001161042c576040516302afb7e560e01b815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000034108061047957507f000000000000000000000000000000000000000000000000000000000000000034115b1561049757604051636c8dabcd60e01b815260040160405180910390fd5b6002547f0000000000000000000000000000000000000000000000000000000000000000036104d95760405163994a405560e01b815260040160405180910390fd5b3460006104e4610a63565b90506000670de0b6b3a76400006104fb8385610d3d565b6105059190610d54565b336000908152600360205260408120859055909150661aa535d3d0c00061053483670de0b6b3a7640000610d3d565b61053e9190610d54565b905083600260008282546105529190610d76565b90915550503360009081526004602052604081208054839290610576908490610d76565b9091555050604080513481526020810183905233917f92258e94db53773befc080125cd404b8a9e5f229599a5c3c3123e83b15107ff1910160405180910390a250505050565b6105c4610b26565b600081116106105760405162461bcd60e51b81526020600482015260146024820152730416d6f756e742073686f756c64206265203e20360641b60448201526064015b60405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561067f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a39190610d89565b50604080516001600160a01b0384168152602081018390527f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b910160405180910390a15050565b6106f2610b26565b6001805460ff60a01b19169055565b610709610b26565b6000471161072a5760405163712c54b360e01b815260040160405180910390fd5b4761073d6000546001600160a01b031690565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610775573d6000803e3d6000fd5b5050565b610781610b26565b6001600160a01b0382166107a85760405163382de3c960e21b815260040160405180910390fd5b600081116107c9576040516364e3d0bd60e11b815260040160405180910390fd5b604080516001600160a01b038416602082015290810182905260009060600160408051601f198184030181528282528051602091820120908301520160408051808303601f1901815290829052805160209091012063095ea7b360e01b82523060048301526024820184905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063095ea7b3906044016020604051808303816000875af115801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae9190610d89565b5061090f8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f00000000000000000000000000000000000000000000000000000000000000009250859150610b539050565b61092c57604051630adf3c7b60e31b815260040160405180910390fd5b6040516323b872dd60e01b81523060048201526001600160a01b038481166024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303816000875af11580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c59190610d89565b6109e25760405163175decfb60e31b815260040160405180910390fd5b604080513081526001600160a01b03851660208201529081018390527f44347b1aec7858b9ab924df67243a402f4afd5e7d5f045176cde4c521350b88b9060600160405180910390a15050505050565b610a3a610b26565b610a446000610b69565b565b610a4e610b26565b6001805460ff60a01b1916600160a01b179055565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610add9190610dc5565b509195945050505050565b610af0610b26565b6001600160a01b038116610b1a57604051631e4fbdf760e01b815260006004820152602401610607565b610b2381610b69565b50565b6000546001600160a01b03163314610a445760405163118cdaa760e01b8152336004820152602401610607565b600082610b608584610bb9565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b8451811015610bfe57610bea82868381518110610bdd57610bdd610e15565b6020026020010151610c08565b915080610bf681610e2b565b915050610bbe565b5090505b92915050565b6000818310610c24576000828152602084905260409020610c33565b60008381526020839052604090205b9392505050565b80356001600160a01b0381168114610c5157600080fd5b919050565b60008060408385031215610c6957600080fd5b610c7283610c3a565b946020939093013593505050565b600060208284031215610c9257600080fd5b610c3382610c3a565b60008060008060608587031215610cb157600080fd5b843567ffffffffffffffff80821115610cc957600080fd5b818701915087601f830112610cdd57600080fd5b813581811115610cec57600080fd5b8860208260051b8501011115610d0157600080fd5b602092830196509450610d179187019050610c3a565b9396929550929360400135925050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610c0257610c02610d27565b600082610d7157634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610c0257610c02610d27565b600060208284031215610d9b57600080fd5b81518015158114610c3357600080fd5b805169ffffffffffffffffffff81168114610c5157600080fd5b600080600080600060a08688031215610ddd57600080fd5b610de686610dab565b9450602086015193506040860151925060608601519150610e0960808701610dab565b90509295509295909350565b634e487b7160e01b600052603260045260246000fd5b600060018201610e3d57610e3d610d27565b506001019056fea26469706673582212205c58d6756a78f2c04d6e944d51995bb898d4dbb5a794e14d78f0d74af7b1c0d064736f6c634300081500330000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000001c6bf52634000000000000000000000000000000000000000000000000000001ff973cafa800000000000000000000000000009321aaa131caa9b4e345beae92d00b716efcf543a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae", 41 | "nonce": "0x99", 42 | "accessList": [] 43 | }, 44 | "additionalContracts": [], 45 | "isFixedGasLimit": false 46 | } 47 | ], 48 | "receipts": [], 49 | "libraries": [], 50 | "pending": [ 51 | "0xa1b4db4b68a955206a00aa1b1edf829ef7881ddbc9a11c8389e89c5dda71c144", 52 | "0x79167beb47a0dba394e56a43277a8feb215834d33d55e115a70e9fa97d0f534e" 53 | ], 54 | "returns": { 55 | "0": { 56 | "internal_type": "contract BemPresale", 57 | "value": "0x07C88116a4c89D4E8Afea7d567fD0c7c0F798F2C" 58 | } 59 | }, 60 | "timestamp": 1707875835, 61 | "chain": 11155111, 62 | "multi": false, 63 | "commit": "1740039" 64 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707875183.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x64d9c3c6c2f288d903670d542d04087910f5b78ce26e45a9c142a3fbb67e65c7", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x10D222Af25037dA8AAb07ef38DC605b4816474e3", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x94", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [], 24 | "libraries": [], 25 | "pending": [ 26 | "0x64d9c3c6c2f288d903670d542d04087910f5b78ce26e45a9c142a3fbb67e65c7" 27 | ], 28 | "returns": { 29 | "0": { 30 | "internal_type": "contract BemToken", 31 | "value": "0x10D222Af25037dA8AAb07ef38DC605b4816474e3" 32 | } 33 | }, 34 | "timestamp": 1707875183, 35 | "chain": 11155111, 36 | "multi": false, 37 | "commit": "1740039" 38 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707875196.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x64d9c3c6c2f288d903670d542d04087910f5b78ce26e45a9c142a3fbb67e65c7", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x10D222Af25037dA8AAb07ef38DC605b4816474e3", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x94", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [ 24 | { 25 | "transactionHash": "0x64d9c3c6c2f288d903670d542d04087910f5b78ce26e45a9c142a3fbb67e65c7", 26 | "transactionIndex": "0x36", 27 | "blockHash": "0xd53904101a7070ec11d394d5adc691ef7eeb6e2bee079aa4e3c96b7dae22f68b", 28 | "blockNumber": "0x509f7f", 29 | "from": "0xE6F3889C8EbB361Fa914Ee78fa4e55b1BBed3A96", 30 | "to": null, 31 | "cumulativeGasUsed": "0x33c044", 32 | "gasUsed": "0xadf36", 33 | "contractAddress": "0x10D222Af25037dA8AAb07ef38DC605b4816474e3", 34 | "logs": [ 35 | { 36 | "address": "0x10D222Af25037dA8AAb07ef38DC605b4816474e3", 37 | "topics": [ 38 | "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", 39 | "0x0000000000000000000000000000000000000000000000000000000000000000", 40 | "0x000000000000000000000000e6f3889c8ebb361fa914ee78fa4e55b1bbed3a96" 41 | ], 42 | "data": "0x", 43 | "blockHash": "0xd53904101a7070ec11d394d5adc691ef7eeb6e2bee079aa4e3c96b7dae22f68b", 44 | "blockNumber": "0x509f7f", 45 | "transactionHash": "0x64d9c3c6c2f288d903670d542d04087910f5b78ce26e45a9c142a3fbb67e65c7", 46 | "transactionIndex": "0x36", 47 | "logIndex": "0x2a", 48 | "removed": false 49 | } 50 | ], 51 | "status": "0x1", 52 | "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000080000000000000000200000000000020004000000000000000000008000000000000000000000000000000000000000000", 53 | "type": "0x2", 54 | "effectiveGasPrice": "0x33a04ba2f" 55 | } 56 | ], 57 | "libraries": [], 58 | "pending": [], 59 | "returns": { 60 | "0": { 61 | "internal_type": "contract BemToken", 62 | "value": "0x10D222Af25037dA8AAb07ef38DC605b4816474e3" 63 | } 64 | }, 65 | "timestamp": 1707875196, 66 | "chain": 11155111, 67 | "multi": false, 68 | "commit": "1740039" 69 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707875796.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x1b1d5d7bcfbac194fa32f8d4627b2ef057c46cfd8f31351db2ffc5ccede0e31e", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0xAf59dB7E4C9DB20eFFDE853B56412cfF1dc3f379", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x97", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [], 24 | "libraries": [], 25 | "pending": [ 26 | "0x1b1d5d7bcfbac194fa32f8d4627b2ef057c46cfd8f31351db2ffc5ccede0e31e" 27 | ], 28 | "returns": { 29 | "0": { 30 | "internal_type": "contract BemToken", 31 | "value": "0xAf59dB7E4C9DB20eFFDE853B56412cfF1dc3f379" 32 | } 33 | }, 34 | "timestamp": 1707875796, 35 | "chain": 11155111, 36 | "multi": false, 37 | "commit": "1740039" 38 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707875809.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x1b1d5d7bcfbac194fa32f8d4627b2ef057c46cfd8f31351db2ffc5ccede0e31e", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0xAf59dB7E4C9DB20eFFDE853B56412cfF1dc3f379", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x97", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [ 24 | { 25 | "transactionHash": "0x1b1d5d7bcfbac194fa32f8d4627b2ef057c46cfd8f31351db2ffc5ccede0e31e", 26 | "transactionIndex": "0x4e", 27 | "blockHash": "0x0566abd6363fe5c40f64081739045ee98a2636076afa54970063a163d43d30b4", 28 | "blockNumber": "0x509fb2", 29 | "from": "0xE6F3889C8EbB361Fa914Ee78fa4e55b1BBed3A96", 30 | "to": null, 31 | "cumulativeGasUsed": "0x77089e", 32 | "gasUsed": "0xadf36", 33 | "contractAddress": "0xAf59dB7E4C9DB20eFFDE853B56412cfF1dc3f379", 34 | "logs": [ 35 | { 36 | "address": "0xAf59dB7E4C9DB20eFFDE853B56412cfF1dc3f379", 37 | "topics": [ 38 | "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", 39 | "0x0000000000000000000000000000000000000000000000000000000000000000", 40 | "0x000000000000000000000000e6f3889c8ebb361fa914ee78fa4e55b1bbed3a96" 41 | ], 42 | "data": "0x", 43 | "blockHash": "0x0566abd6363fe5c40f64081739045ee98a2636076afa54970063a163d43d30b4", 44 | "blockNumber": "0x509fb2", 45 | "transactionHash": "0x1b1d5d7bcfbac194fa32f8d4627b2ef057c46cfd8f31351db2ffc5ccede0e31e", 46 | "transactionIndex": "0x4e", 47 | "logIndex": "0x7c", 48 | "removed": false 49 | } 50 | ], 51 | "status": "0x1", 52 | "logsBloom": "0x00000000000000000000000000000000000000040000000400800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800400000000000000000000000000000400000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000080000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", 53 | "type": "0x2", 54 | "effectiveGasPrice": "0x314bb3494" 55 | } 56 | ], 57 | "libraries": [], 58 | "pending": [], 59 | "returns": { 60 | "0": { 61 | "internal_type": "contract BemToken", 62 | "value": "0xAf59dB7E4C9DB20eFFDE853B56412cfF1dc3f379" 63 | } 64 | }, 65 | "timestamp": 1707875809, 66 | "chain": 11155111, 67 | "multi": false, 68 | "commit": "1740039" 69 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707897884.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x347979d06759bb0f038cfe64e8865fbdba6203f952b235b5aabfee31ffcefed5", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x54CDf5787f7b5B585687Fe83cD1A460fe5b94c7f", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0x9e", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [], 24 | "libraries": [], 25 | "pending": [ 26 | "0x347979d06759bb0f038cfe64e8865fbdba6203f952b235b5aabfee31ffcefed5" 27 | ], 28 | "returns": { 29 | "0": { 30 | "internal_type": "contract BemToken", 31 | "value": "0x54CDf5787f7b5B585687Fe83cD1A460fe5b94c7f" 32 | } 33 | }, 34 | "timestamp": 1707897884, 35 | "chain": 11155111, 36 | "multi": false, 37 | "commit": "9750505" 38 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707897891.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x347979d06759bb0f038cfe64e8865fbdba6203f952b235b5aabfee31ffcefed5", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x54CDf5787f7b5B585687Fe83cD1A460fe5b94c7f", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0x9e", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [ 24 | { 25 | "transactionHash": "0x347979d06759bb0f038cfe64e8865fbdba6203f952b235b5aabfee31ffcefed5", 26 | "transactionIndex": "0x32", 27 | "blockHash": "0xa22bff6678e3ddd004c1c376a5d5be92786509de8cd487708a54c288b7e3f21f", 28 | "blockNumber": "0x50a6e0", 29 | "from": "0xE6F3889C8EbB361Fa914Ee78fa4e55b1BBed3A96", 30 | "to": null, 31 | "cumulativeGasUsed": "0x5ac756", 32 | "gasUsed": "0xadf36", 33 | "contractAddress": "0x54CDf5787f7b5B585687Fe83cD1A460fe5b94c7f", 34 | "logs": [ 35 | { 36 | "address": "0x54CDf5787f7b5B585687Fe83cD1A460fe5b94c7f", 37 | "topics": [ 38 | "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", 39 | "0x0000000000000000000000000000000000000000000000000000000000000000", 40 | "0x000000000000000000000000e6f3889c8ebb361fa914ee78fa4e55b1bbed3a96" 41 | ], 42 | "data": "0x", 43 | "blockHash": "0xa22bff6678e3ddd004c1c376a5d5be92786509de8cd487708a54c288b7e3f21f", 44 | "blockNumber": "0x50a6e0", 45 | "transactionHash": "0x347979d06759bb0f038cfe64e8865fbdba6203f952b235b5aabfee31ffcefed5", 46 | "transactionIndex": "0x32", 47 | "logIndex": "0x4c", 48 | "removed": false 49 | } 50 | ], 51 | "status": "0x1", 52 | "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000020000000000000000000000400000000000000000000000000400004000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000001000000000000000000000000000080000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", 53 | "type": "0x2", 54 | "effectiveGasPrice": "0xcc9ca6f2" 55 | } 56 | ], 57 | "libraries": [], 58 | "pending": [], 59 | "returns": { 60 | "0": { 61 | "internal_type": "contract BemToken", 62 | "value": "0x54CDf5787f7b5B585687Fe83cD1A460fe5b94c7f" 63 | } 64 | }, 65 | "timestamp": 1707897891, 66 | "chain": 11155111, 67 | "multi": false, 68 | "commit": "9750505" 69 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707920469.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0xa5", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [], 24 | "libraries": [], 25 | "pending": [ 26 | "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4" 27 | ], 28 | "returns": { 29 | "0": { 30 | "internal_type": "contract BemToken", 31 | "value": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9" 32 | } 33 | }, 34 | "timestamp": 1707920469, 35 | "chain": 11155111, 36 | "multi": false, 37 | "commit": "7b65599" 38 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-1707920476.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0xa5", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [ 24 | { 25 | "transactionHash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 26 | "transactionIndex": "0x28", 27 | "blockHash": "0x3dd58922ce2c0657714c0e4fe8d298a9e9d5f713a4212eed7808e0467eb4a1d5", 28 | "blockNumber": "0x50ae38", 29 | "from": "0xE6F3889C8EbB361Fa914Ee78fa4e55b1BBed3A96", 30 | "to": null, 31 | "cumulativeGasUsed": "0x39dd9a", 32 | "gasUsed": "0xadf36", 33 | "contractAddress": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 34 | "logs": [ 35 | { 36 | "address": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 37 | "topics": [ 38 | "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", 39 | "0x0000000000000000000000000000000000000000000000000000000000000000", 40 | "0x000000000000000000000000e6f3889c8ebb361fa914ee78fa4e55b1bbed3a96" 41 | ], 42 | "data": "0x", 43 | "blockHash": "0x3dd58922ce2c0657714c0e4fe8d298a9e9d5f713a4212eed7808e0467eb4a1d5", 44 | "blockNumber": "0x50ae38", 45 | "transactionHash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 46 | "transactionIndex": "0x28", 47 | "logIndex": "0x3b", 48 | "removed": false 49 | } 50 | ], 51 | "status": "0x1", 52 | "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800800000000000000000000000000000400000000000000000000000000000004000000000000000000000000000000000000000000000020000400000000000000000000000000000000000000000000001000000000000000000000000000080000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", 53 | "type": "0x2", 54 | "effectiveGasPrice": "0x13dc7b6aa" 55 | } 56 | ], 57 | "libraries": [], 58 | "pending": [], 59 | "returns": { 60 | "0": { 61 | "internal_type": "contract BemToken", 62 | "value": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9" 63 | } 64 | }, 65 | "timestamp": 1707920476, 66 | "chain": 11155111, 67 | "multi": false, 68 | "commit": "7b65599" 69 | } -------------------------------------------------------------------------------- /broadcast/DeployBemToken.s.sol/11155111/run-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0xa5", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | } 22 | ], 23 | "receipts": [ 24 | { 25 | "transactionHash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 26 | "transactionIndex": "0x28", 27 | "blockHash": "0x3dd58922ce2c0657714c0e4fe8d298a9e9d5f713a4212eed7808e0467eb4a1d5", 28 | "blockNumber": "0x50ae38", 29 | "from": "0xE6F3889C8EbB361Fa914Ee78fa4e55b1BBed3A96", 30 | "to": null, 31 | "cumulativeGasUsed": "0x39dd9a", 32 | "gasUsed": "0xadf36", 33 | "contractAddress": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 34 | "logs": [ 35 | { 36 | "address": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9", 37 | "topics": [ 38 | "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", 39 | "0x0000000000000000000000000000000000000000000000000000000000000000", 40 | "0x000000000000000000000000e6f3889c8ebb361fa914ee78fa4e55b1bbed3a96" 41 | ], 42 | "data": "0x", 43 | "blockHash": "0x3dd58922ce2c0657714c0e4fe8d298a9e9d5f713a4212eed7808e0467eb4a1d5", 44 | "blockNumber": "0x50ae38", 45 | "transactionHash": "0xeef910b8d43e6b339dba464969a13eebd47de9b36168b9a39247115facd247d4", 46 | "transactionIndex": "0x28", 47 | "logIndex": "0x3b", 48 | "removed": false 49 | } 50 | ], 51 | "status": "0x1", 52 | "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800800000000000000000000000000000400000000000000000000000000000004000000000000000000000000000000000000000000000020000400000000000000000000000000000000000000000000001000000000000000000000000000080000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", 53 | "type": "0x2", 54 | "effectiveGasPrice": "0x13dc7b6aa" 55 | } 56 | ], 57 | "libraries": [], 58 | "pending": [], 59 | "returns": { 60 | "0": { 61 | "internal_type": "contract BemToken", 62 | "value": "0x38bf30a1F7B528A3f1261f41B2843451CD8574D9" 63 | } 64 | }, 65 | "timestamp": 1707920476, 66 | "chain": 11155111, 67 | "multi": false, 68 | "commit": "7b65599" 69 | } -------------------------------------------------------------------------------- /broadcast/DeployBemVesting.s.sol/11155111/run-1707875876.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0x5c4c2019f2de416ea5858b66988fc7b94b34761967a8edaf11ba029cc80d94fc", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x5069C84a1aF8603a59aBbEd2eD14F095898b3d98", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea26469706673582212201bf6b0871ce82ceb05f9807e25d4cfbcc6985bc24c746cb244e8e78d4426201464736f6c63430008150033", 16 | "nonce": "0x9a", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | }, 22 | { 23 | "hash": "0x7e26efd8e6e02264470a0b8d3f97c2ecc76b8ad3de8345c109511d864ac10626", 24 | "transactionType": "CREATE", 25 | "contractName": "PresaleTokenVesting", 26 | "contractAddress": "0x83B7ff28224270D4869339f9E7Cca9b5379BeE92", 27 | "function": null, 28 | "arguments": [ 29 | "0x5069C84a1aF8603a59aBbEd2eD14F095898b3d98", 30 | "0x876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee" 31 | ], 32 | "transaction": { 33 | "type": "0x02", 34 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 35 | "gas": "0x11ad90", 36 | "value": "0x0", 37 | "data": "0x60c060405234801561001057600080fd5b50604051610ffe380380610ffe83398101604081905261002f916100ec565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e8161009c565b506001600160a01b0382166100865760405163443c9c8d60e01b815260040160405180910390fd5b6001600160a01b0390911660805260a052610126565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156100ff57600080fd5b82516001600160a01b038116811461011657600080fd5b6020939093015192949293505050565b60805160a051610ea56101596000396000818161024b01526107450152600081816104b901526105510152610ea56000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637b26046011610097578063e8cb5d9411610066578063e8cb5d941461026d578063f2fde38b14610278578063f74733161461028b578063f9b85b541461029657600080fd5b80637b260460146102165780638da5cb5b14610221578063be1b7b4c1461023c578063c73b959b1461024657600080fd5b80636641cef9116100d35780636641cef91461017a57806367d42a8b146101e6578063715018a6146101fb57806378f2eb9b1461020357600080fd5b806333bf5cf2146100fa5780634cfc4d3014610120578063661b743d1461012b575b600080fd5b61010d610108366004610c6f565b6102a9565b6040519081526020015b60405180910390f35b61010d6303c2670081565b61013e610139366004610c6f565b610310565b604051610117919081516001600160a01b0316815260208083015190820152604080830151908201526060918201519181019190915260800190565b6101bc610188366004610c6f565b600160208190526000918252604090912080549181015460028201546003909201546001600160a01b039093169290919084565b604080516001600160a01b0390951685526020850193909352918301526060820152608001610117565b6101f96101f4366004610c6f565b610391565b005b6101f961064d565b6101f9610211366004610ca4565b610661565b61010d6302c7ea0081565b6000546040516001600160a01b039091168152602001610117565b61010d62ed4e0081565b61010d7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6301da9c0081565b6101f9610286366004610d2e565b610906565b61010d630251430081565b61010d6102a4366004610d2e565b610944565b6000818152600160208181526040808420815160808101835281546001600160a01b031681529381015492840192909252600282015490830152600301546060820152816102f68461099f565b90508160400151816103089190610d5f565b949350505050565b610344604051806080016040528060006001600160a01b031681526020016000815260200160008152602001600081525090565b50600090815260016020818152604092839020835160808101855281546001600160a01b031681529281015491830191909152600281015492820192909252600390910154606082015290565b6103c16040518060400160405280600e81526020016d3932b632b0b9b2a1b0b63632b91d60911b81525033610ab2565b6000818152600160205260409020546001600160a01b03163314806103f95760405163036f6f8960e61b815260040160405180910390fd5b60008281526001602081905260409091209081015461042b5760405163645316a160e01b815260040160405180910390fd5b80600201548160010154036104535760405163c4c3c11160e01b815260040160405180910390fd5b600061045e846102a9565b905060008111610484576040516001623087dd60e21b0319815260040160405180910390fd5b808260020160008282546104989190610d72565b909155505060405163095ea7b360e01b8152306004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063095ea7b3906044016020604051808303816000875af115801561050a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052e9190610d85565b506040516323b872dd60e01b8152306004820152336024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af11580156105a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c69190610d85565b61060e5760405162461bcd60e51b8152602060048201526014602482015273151bdad95b881c995b19585cd94819985a5b195960621b60448201526064015b60405180910390fd5b60408051338152602081018390527fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179910160405180910390a150505050565b610655610afb565b61065f6000610b28565b565b610669610afb565b600080841161068b5760405163119e315b60e11b815260040160405180910390fd5b60008181526001602081905260409091200154156106bc57604051632e6d838760e01b815260040160405180910390fd5b604080516001600160a01b038716602082015290810185905260009060600160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506107708484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f00000000000000000000000000000000000000000000000000000000000000009250859150610b789050565b61078d57604051630e8a459760e31b815260040160405180910390fd5b61079686610944565b91506107c66040518060400160405280600c81526020016b3132b732b334b1b4b0b93c9d60a11b81525087610ab2565b6107cf82610b8e565b6040518060800160405280876001600160a01b03168152602001868152602001600081526020016107fd4290565b90526000838152600160208181526040808420855181546001600160a01b0319166001600160a01b039182161782558684015182860155868301516002808401919091556060909701516003909201919091558b1684529390529190205490610867908290610d72565b6001600160a01b0388811660008181526002602081815260408084209690965588835260018082529286902086519485529084018c9052428487015260608401899052805490941660808401529083015460a083015282015460c082015260039091015460e082015290517ffa5982c664d9800dc3438e37ce1527e271030acc8f35e91c6345440227d33ec3918190036101000190a150505050505050565b61090e610afb565b6001600160a01b03811661093857604051631e4fbdf760e01b815260006004820152602401610605565b61094181610b28565b50565b6001600160a01b0381166000908152600260209081526040808320548151606086901b6bffffffffffffffffffffffff1916818501526034808201929092528251808203909201825260540190915280519101205b92915050565b6000818152600160208181526040808420815160808101835281546001600160a01b031681529381015492840192909252600282015490830152600301546060820181905282906109f09042610d5f565b602083015190915062ed4e00821015610a0e57506000949350505050565b62ed4e008210158015610a2457506301da9c0082105b15610a49576064610a36826019610da7565b610a409190610dbe565b95945050505050565b6301da9c008210158015610a605750630251430082105b15610a72576064610a36826032610da7565b63025143008210158015610a8957506302c7ea0082105b15610a9b576064610a3682604b610da7565b6302c7ea008210610308576064610a368282610da7565b610af78282604051602401610ac8929190610de0565b60408051601f198184030181529190526020810180516001600160e01b031663319af33360e01b179052610bcf565b5050565b6000546001600160a01b0316331461065f5760405163118cdaa760e01b8152336004820152602401610605565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610b858584610bf0565b14949350505050565b61094181604051602401610ba491815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166327b7cf8560e01b1790525b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b600081815b8451811015610c3557610c2182868381518110610c1457610c14610e40565b6020026020010151610c3d565b915080610c2d81610e56565b915050610bf5565b509392505050565b6000818310610c59576000828152602084905260409020610c68565b60008381526020839052604090205b9392505050565b600060208284031215610c8157600080fd5b5035919050565b80356001600160a01b0381168114610c9f57600080fd5b919050565b60008060008060608587031215610cba57600080fd5b610cc385610c88565b935060208501359250604085013567ffffffffffffffff80821115610ce757600080fd5b818701915087601f830112610cfb57600080fd5b813581811115610d0a57600080fd5b8860208260051b8501011115610d1f57600080fd5b95989497505060200194505050565b600060208284031215610d4057600080fd5b610c6882610c88565b634e487b7160e01b600052601160045260246000fd5b8181038181111561099957610999610d49565b8082018082111561099957610999610d49565b600060208284031215610d9757600080fd5b81518015158114610c6857600080fd5b808202811582820484141761099957610999610d49565b600082610ddb57634e487b7160e01b600052601260045260246000fd5b500490565b604081526000835180604084015260005b81811015610e0e5760208187018101516060868401015201610df1565b50600060608285018101919091526001600160a01b03949094166020840152601f01601f191690910190910192915050565b634e487b7160e01b600052603260045260246000fd5b600060018201610e6857610e68610d49565b506001019056fea264697066735822122078210ca974961e525075b60ba737d15197385d7d9669da83228f2dfc76f7519964736f6c634300081500330000000000000000000000005069c84a1af8603a59abbed2ed14f095898b3d98876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee", 38 | "nonce": "0x9b", 39 | "accessList": [] 40 | }, 41 | "additionalContracts": [], 42 | "isFixedGasLimit": false 43 | } 44 | ], 45 | "receipts": [], 46 | "libraries": [], 47 | "pending": [ 48 | "0x5c4c2019f2de416ea5858b66988fc7b94b34761967a8edaf11ba029cc80d94fc", 49 | "0x7e26efd8e6e02264470a0b8d3f97c2ecc76b8ad3de8345c109511d864ac10626" 50 | ], 51 | "returns": { 52 | "0": { 53 | "internal_type": "contract PresaleTokenVesting", 54 | "value": "0x83B7ff28224270D4869339f9E7Cca9b5379BeE92" 55 | } 56 | }, 57 | "timestamp": 1707875876, 58 | "chain": 11155111, 59 | "multi": false, 60 | "commit": "1740039" 61 | } -------------------------------------------------------------------------------- /broadcast/DeployBemVesting.s.sol/11155111/run-1707897949.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0xdcd7b9bab2a821e62410e04d6ab8a16584b1de4e7b2a33542f9ee24228bdc4ee", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0x44270daf4325700c78AAd1f514848cd88fa6959B", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0xa1", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | }, 22 | { 23 | "hash": "0x1a6738145d290418fd3c1f12b75e9e21fd38c22422e1709898925692e2c0f570", 24 | "transactionType": "CREATE", 25 | "contractName": "PresaleTokenVesting", 26 | "contractAddress": "0x2892d963544c49e390F9348E127ebFf70ddaC172", 27 | "function": null, 28 | "arguments": [ 29 | "0x44270daf4325700c78AAd1f514848cd88fa6959B", 30 | "0x876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee" 31 | ], 32 | "transaction": { 33 | "type": "0x02", 34 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 35 | "gas": "0x11ad80", 36 | "value": "0x0", 37 | "data": "0x60c060405234801561001057600080fd5b50604051610ffe380380610ffe83398101604081905261002f916100ec565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e8161009c565b506001600160a01b0382166100865760405163443c9c8d60e01b815260040160405180910390fd5b6001600160a01b0390911660805260a052610126565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156100ff57600080fd5b82516001600160a01b038116811461011657600080fd5b6020939093015192949293505050565b60805160a051610ea56101596000396000818161024b01526107450152600081816104b901526105510152610ea56000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637b26046011610097578063e8cb5d9411610066578063e8cb5d941461026d578063f2fde38b14610278578063f74733161461028b578063f9b85b541461029657600080fd5b80637b260460146102165780638da5cb5b14610221578063be1b7b4c1461023c578063c73b959b1461024657600080fd5b80636641cef9116100d35780636641cef91461017a57806367d42a8b146101e6578063715018a6146101fb57806378f2eb9b1461020357600080fd5b806333bf5cf2146100fa5780634cfc4d3014610120578063661b743d1461012b575b600080fd5b61010d610108366004610c6f565b6102a9565b6040519081526020015b60405180910390f35b61010d6303c2670081565b61013e610139366004610c6f565b610310565b604051610117919081516001600160a01b0316815260208083015190820152604080830151908201526060918201519181019190915260800190565b6101bc610188366004610c6f565b600160208190526000918252604090912080549181015460028201546003909201546001600160a01b039093169290919084565b604080516001600160a01b0390951685526020850193909352918301526060820152608001610117565b6101f96101f4366004610c6f565b610391565b005b6101f961064d565b6101f9610211366004610ca4565b610661565b61010d6302c7ea0081565b6000546040516001600160a01b039091168152602001610117565b61010d62ed4e0081565b61010d7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6301da9c0081565b6101f9610286366004610d2e565b610906565b61010d630251430081565b61010d6102a4366004610d2e565b610944565b6000818152600160208181526040808420815160808101835281546001600160a01b031681529381015492840192909252600282015490830152600301546060820152816102f68461099f565b90508160400151816103089190610d5f565b949350505050565b610344604051806080016040528060006001600160a01b031681526020016000815260200160008152602001600081525090565b50600090815260016020818152604092839020835160808101855281546001600160a01b031681529281015491830191909152600281015492820192909252600390910154606082015290565b6103c16040518060400160405280600e81526020016d3932b632b0b9b2a1b0b63632b91d60911b81525033610ab2565b6000818152600160205260409020546001600160a01b03163314806103f95760405163036f6f8960e61b815260040160405180910390fd5b60008281526001602081905260409091209081015461042b5760405163645316a160e01b815260040160405180910390fd5b80600201548160010154036104535760405163c4c3c11160e01b815260040160405180910390fd5b600061045e846102a9565b905060008111610484576040516001623087dd60e21b0319815260040160405180910390fd5b808260020160008282546104989190610d72565b909155505060405163095ea7b360e01b8152306004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063095ea7b3906044016020604051808303816000875af115801561050a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052e9190610d85565b506040516323b872dd60e01b8152306004820152336024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af11580156105a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c69190610d85565b61060e5760405162461bcd60e51b8152602060048201526014602482015273151bdad95b881c995b19585cd94819985a5b195960621b60448201526064015b60405180910390fd5b60408051338152602081018390527fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179910160405180910390a150505050565b610655610afb565b61065f6000610b28565b565b610669610afb565b600080841161068b5760405163119e315b60e11b815260040160405180910390fd5b60008181526001602081905260409091200154156106bc57604051632e6d838760e01b815260040160405180910390fd5b604080516001600160a01b038716602082015290810185905260009060600160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506107708484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f00000000000000000000000000000000000000000000000000000000000000009250859150610b789050565b61078d57604051630e8a459760e31b815260040160405180910390fd5b61079686610944565b91506107c66040518060400160405280600c81526020016b3132b732b334b1b4b0b93c9d60a11b81525087610ab2565b6107cf82610b8e565b6040518060800160405280876001600160a01b03168152602001868152602001600081526020016107fd4290565b90526000838152600160208181526040808420855181546001600160a01b0319166001600160a01b039182161782558684015182860155868301516002808401919091556060909701516003909201919091558b1684529390529190205490610867908290610d72565b6001600160a01b0388811660008181526002602081815260408084209690965588835260018082529286902086519485529084018c9052428487015260608401899052805490941660808401529083015460a083015282015460c082015260039091015460e082015290517ffa5982c664d9800dc3438e37ce1527e271030acc8f35e91c6345440227d33ec3918190036101000190a150505050505050565b61090e610afb565b6001600160a01b03811661093857604051631e4fbdf760e01b815260006004820152602401610605565b61094181610b28565b50565b6001600160a01b0381166000908152600260209081526040808320548151606086901b6bffffffffffffffffffffffff1916818501526034808201929092528251808203909201825260540190915280519101205b92915050565b6000818152600160208181526040808420815160808101835281546001600160a01b031681529381015492840192909252600282015490830152600301546060820181905282906109f09042610d5f565b602083015190915062ed4e00821015610a0e57506000949350505050565b62ed4e008210158015610a2457506301da9c0082105b15610a49576064610a36826019610da7565b610a409190610dbe565b95945050505050565b6301da9c008210158015610a605750630251430082105b15610a72576064610a36826032610da7565b63025143008210158015610a8957506302c7ea0082105b15610a9b576064610a3682604b610da7565b6302c7ea008210610308576064610a368282610da7565b610af78282604051602401610ac8929190610de0565b60408051601f198184030181529190526020810180516001600160e01b031663319af33360e01b179052610bcf565b5050565b6000546001600160a01b0316331461065f5760405163118cdaa760e01b8152336004820152602401610605565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610b858584610bf0565b14949350505050565b61094181604051602401610ba491815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166327b7cf8560e01b1790525b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b600081815b8451811015610c3557610c2182868381518110610c1457610c14610e40565b6020026020010151610c3d565b915080610c2d81610e56565b915050610bf5565b509392505050565b6000818310610c59576000828152602084905260409020610c68565b60008381526020839052604090205b9392505050565b600060208284031215610c8157600080fd5b5035919050565b80356001600160a01b0381168114610c9f57600080fd5b919050565b60008060008060608587031215610cba57600080fd5b610cc385610c88565b935060208501359250604085013567ffffffffffffffff80821115610ce757600080fd5b818701915087601f830112610cfb57600080fd5b813581811115610d0a57600080fd5b8860208260051b8501011115610d1f57600080fd5b95989497505060200194505050565b600060208284031215610d4057600080fd5b610c6882610c88565b634e487b7160e01b600052601160045260246000fd5b8181038181111561099957610999610d49565b8082018082111561099957610999610d49565b600060208284031215610d9757600080fd5b81518015158114610c6857600080fd5b808202811582820484141761099957610999610d49565b600082610ddb57634e487b7160e01b600052601260045260246000fd5b500490565b604081526000835180604084015260005b81811015610e0e5760208187018101516060868401015201610df1565b50600060608285018101919091526001600160a01b03949094166020840152601f01601f191690910190910192915050565b634e487b7160e01b600052603260045260246000fd5b600060018201610e6857610e68610d49565b506001019056fea2646970667358221220a994c29d43da8c587c1cfa1d6aaf9824e09b906e024c914cb7ad04b3973600d364736f6c6343000815003300000000000000000000000044270daf4325700c78aad1f514848cd88fa6959b876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee", 38 | "nonce": "0xa2", 39 | "accessList": [] 40 | }, 41 | "additionalContracts": [], 42 | "isFixedGasLimit": false 43 | } 44 | ], 45 | "receipts": [], 46 | "libraries": [], 47 | "pending": [ 48 | "0xdcd7b9bab2a821e62410e04d6ab8a16584b1de4e7b2a33542f9ee24228bdc4ee", 49 | "0x1a6738145d290418fd3c1f12b75e9e21fd38c22422e1709898925692e2c0f570" 50 | ], 51 | "returns": { 52 | "0": { 53 | "internal_type": "contract PresaleTokenVesting", 54 | "value": "0x2892d963544c49e390F9348E127ebFf70ddaC172" 55 | } 56 | }, 57 | "timestamp": 1707897949, 58 | "chain": 11155111, 59 | "multi": false, 60 | "commit": "9750505" 61 | } -------------------------------------------------------------------------------- /broadcast/DeployBemVesting.s.sol/11155111/run-1707920559.json: -------------------------------------------------------------------------------- 1 | { 2 | "transactions": [ 3 | { 4 | "hash": "0xe278355c381ed4f1e8c9014c8c27b929b3d74cc1a3d3b2b09269df3ae931b76f", 5 | "transactionType": "CREATE", 6 | "contractName": "BemToken", 7 | "contractAddress": "0xb041B040b350cc6Bd75b38f94E6461CfC7c40135", 8 | "function": null, 9 | "arguments": null, 10 | "transaction": { 11 | "type": "0x02", 12 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 13 | "gas": "0xe211b", 14 | "value": "0x0", 15 | "data": "0x60a06040523480156200001157600080fd5b50336040518060400160405280600381526020016242454d60e81b81525060405180604001604052806002815260200161424d60f01b81525081600390816200005b9190620001a5565b5060046200006a8282620001a5565b5050506001600160a01b0381166200009c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000a781620000ae565b5062000271565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012b57607f821691505b6020821081036200014c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a057600081815260208120601f850160051c810160208610156200017b5750805b601f850160051c820191505b818110156200019c5782815560010162000187565b5050505b505050565b81516001600160401b03811115620001c157620001c162000100565b620001d981620001d2845462000116565b8462000152565b602080601f831160018114620002115760008415620001f85750858301515b600019600386901b1c1916600185901b1785556200019c565b600085815260208120601f198616915b82811015620002425788860151825594840194600190910190840162000221565b5085821015620002615787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051610a826200028d600039600061023e0152610a826000f3fe608060405234801561001057600080fd5b506004361061010a5760003560e01c8063715018a6116100a2578063a9059cbb11610071578063a9059cbb14610213578063b608bfbe14610226578063c73b959b14610239578063dd62ed3e14610260578063f2fde38b1461029957600080fd5b8063715018a6146101d557806380ee7ee1146101dd5780638da5cb5b146101f057806395d89b411461020b57600080fd5b806318160ddd116100de57806318160ddd1461017857806323b872dd1461018a578063313ce5671461019d57806370a08231146101ac57600080fd5b806215d4bd1461010f57806305a0ba7e1461012457806306fdde0314610137578063095ea7b314610155575b600080fd5b61012261011d3660046108cf565b6102ac565b005b6101226101323660046108f9565b6102c4565b61013f610313565b60405161014c9190610912565b60405180910390f35b6101686101633660046108cf565b6103a5565b604051901515815260200161014c565b6002545b60405190815260200161014c565b610168610198366004610960565b6103bf565b6040516012815260200161014c565b61017c6101ba36600461099c565b6001600160a01b031660009081526020819052604090205490565b6101226103e3565b6101226101eb3660046108f9565b6103f7565b6005546040516001600160a01b03909116815260200161014c565b61013f610437565b6101686102213660046108cf565b610446565b6101226102343660046108f9565b610454565b61017c7f000000000000000000000000000000000000000000000000000000000000000081565b61017c61026e3660046109be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101226102a736600461099c565b61049c565b6102b46104df565b6102bf3083836103bf565b505050565b6102cc6104df565b6102d6308261050c565b60408051338152602081018390527f226a6b44807e7c97766c19659cf5db0e12f309280ea2595f9c2e7075d738c54091015b60405180910390a150565b606060038054610322906109f1565b80601f016020809104026020016040519081016040528092919081815260200182805461034e906109f1565b801561039b5780601f106103705761010080835404028352916020019161039b565b820191906000526020600020905b81548152906001019060200180831161037e57829003601f168201915b5050505050905090565b6000336103b3818585610546565b60019150505b92915050565b6000336103cd858285610553565b6103d88585856105d1565b506001949350505050565b6103eb6104df565b6103f56000610630565b565b610401308261050c565b60408051338152602081018390527f34d29d553f367e2c9e54a44494a540c7e1da1b187ea097c7cd5af1d90a172d3a9101610308565b606060048054610322906109f1565b6000336103b38185856105d1565b61045c6104df565b6104663082610682565b60408051308152602081018390527f919f7e2092ffcc9d09f599be18d8152860b0c054df788a33bc549cdd9d0f15b19101610308565b6104a46104df565b6001600160a01b0381166104d357604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6104dc81610630565b50565b6005546001600160a01b031633146103f55760405163118cdaa760e01b81523360048201526024016104ca565b6001600160a01b0382166105365760405163ec442f0560e01b8152600060048201526024016104ca565b610542600083836106b4565b5050565b6102bf83838360016107de565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105cb57818110156105bc57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016104ca565b6105cb848484840360006107de565b50505050565b6001600160a01b0383166105fb57604051634b637e8f60e11b8152600060048201526024016104ca565b6001600160a01b0382166106255760405163ec442f0560e01b8152600060048201526024016104ca565b6102bf8383836106b4565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166106ac57604051634b637e8f60e11b8152600060048201526024016104ca565b610542826000835b6001600160a01b0383166106df5780600260008282546106d49190610a2b565b909155506107519050565b6001600160a01b038316600090815260208190526040902054818110156107325760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016104ca565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661076d5760028054829003905561078c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516107d191815260200190565b60405180910390a3505050565b6001600160a01b0384166108085760405163e602df0560e01b8152600060048201526024016104ca565b6001600160a01b03831661083257604051634a1406b160e11b8152600060048201526024016104ca565b6001600160a01b03808516600090815260016020908152604080832093871683529290522082905580156105cb57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516108a591815260200190565b60405180910390a350505050565b80356001600160a01b03811681146108ca57600080fd5b919050565b600080604083850312156108e257600080fd5b6108eb836108b3565b946020939093013593505050565b60006020828403121561090b57600080fd5b5035919050565b600060208083528351808285015260005b8181101561093f57858101830151858201604001528201610923565b506000604082860101526040601f19601f8301168501019250505092915050565b60008060006060848603121561097557600080fd5b61097e846108b3565b925061098c602085016108b3565b9150604084013590509250925092565b6000602082840312156109ae57600080fd5b6109b7826108b3565b9392505050565b600080604083850312156109d157600080fd5b6109da836108b3565b91506109e8602084016108b3565b90509250929050565b600181811c90821680610a0557607f821691505b602082108103610a2557634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156103b957634e487b7160e01b600052601160045260246000fdfea2646970667358221220dcbef9ab48a4a56ec75a7b1fea58879ad73f50cbd9b0b1f4f93d22e8337f5a6a64736f6c63430008150033", 16 | "nonce": "0xa8", 17 | "accessList": [] 18 | }, 19 | "additionalContracts": [], 20 | "isFixedGasLimit": false 21 | }, 22 | { 23 | "hash": "0xbb0ad6a6ac35ec4966c12b4f6ba8d8df9a9281443b8cf4d58a86e5ca9ff2577e", 24 | "transactionType": "CREATE", 25 | "contractName": "PresaleTokenVesting", 26 | "contractAddress": "0xfDd00E9377e8121F72A4fe760Bb77f05d838EbF0", 27 | "function": null, 28 | "arguments": [ 29 | "0xb041B040b350cc6Bd75b38f94E6461CfC7c40135", 30 | "0x876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee" 31 | ], 32 | "transaction": { 33 | "type": "0x02", 34 | "from": "0xe6f3889c8ebb361fa914ee78fa4e55b1bbed3a96", 35 | "gas": "0x11ad80", 36 | "value": "0x0", 37 | "data": "0x60c060405234801561001057600080fd5b50604051610ffe380380610ffe83398101604081905261002f916100ec565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e8161009c565b506001600160a01b0382166100865760405163443c9c8d60e01b815260040160405180910390fd5b6001600160a01b0390911660805260a052610126565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156100ff57600080fd5b82516001600160a01b038116811461011657600080fd5b6020939093015192949293505050565b60805160a051610ea56101596000396000818161024b01526107450152600081816104b901526105510152610ea56000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637b26046011610097578063e8cb5d9411610066578063e8cb5d941461026d578063f2fde38b14610278578063f74733161461028b578063f9b85b541461029657600080fd5b80637b260460146102165780638da5cb5b14610221578063be1b7b4c1461023c578063c73b959b1461024657600080fd5b80636641cef9116100d35780636641cef91461017a57806367d42a8b146101e6578063715018a6146101fb57806378f2eb9b1461020357600080fd5b806333bf5cf2146100fa5780634cfc4d3014610120578063661b743d1461012b575b600080fd5b61010d610108366004610c6f565b6102a9565b6040519081526020015b60405180910390f35b61010d6303c2670081565b61013e610139366004610c6f565b610310565b604051610117919081516001600160a01b0316815260208083015190820152604080830151908201526060918201519181019190915260800190565b6101bc610188366004610c6f565b600160208190526000918252604090912080549181015460028201546003909201546001600160a01b039093169290919084565b604080516001600160a01b0390951685526020850193909352918301526060820152608001610117565b6101f96101f4366004610c6f565b610391565b005b6101f961064d565b6101f9610211366004610ca4565b610661565b61010d6302c7ea0081565b6000546040516001600160a01b039091168152602001610117565b61010d62ed4e0081565b61010d7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6301da9c0081565b6101f9610286366004610d2e565b610906565b61010d630251430081565b61010d6102a4366004610d2e565b610944565b6000818152600160208181526040808420815160808101835281546001600160a01b031681529381015492840192909252600282015490830152600301546060820152816102f68461099f565b90508160400151816103089190610d5f565b949350505050565b610344604051806080016040528060006001600160a01b031681526020016000815260200160008152602001600081525090565b50600090815260016020818152604092839020835160808101855281546001600160a01b031681529281015491830191909152600281015492820192909252600390910154606082015290565b6103c16040518060400160405280600e81526020016d3932b632b0b9b2a1b0b63632b91d60911b81525033610ab2565b6000818152600160205260409020546001600160a01b03163314806103f95760405163036f6f8960e61b815260040160405180910390fd5b60008281526001602081905260409091209081015461042b5760405163645316a160e01b815260040160405180910390fd5b80600201548160010154036104535760405163c4c3c11160e01b815260040160405180910390fd5b600061045e846102a9565b905060008111610484576040516001623087dd60e21b0319815260040160405180910390fd5b808260020160008282546104989190610d72565b909155505060405163095ea7b360e01b8152306004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063095ea7b3906044016020604051808303816000875af115801561050a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052e9190610d85565b506040516323b872dd60e01b8152306004820152336024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af11580156105a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c69190610d85565b61060e5760405162461bcd60e51b8152602060048201526014602482015273151bdad95b881c995b19585cd94819985a5b195960621b60448201526064015b60405180910390fd5b60408051338152602081018390527fc7798891864187665ac6dd119286e44ec13f014527aeeb2b8eb3fd413df93179910160405180910390a150505050565b610655610afb565b61065f6000610b28565b565b610669610afb565b600080841161068b5760405163119e315b60e11b815260040160405180910390fd5b60008181526001602081905260409091200154156106bc57604051632e6d838760e01b815260040160405180910390fd5b604080516001600160a01b038716602082015290810185905260009060600160408051601f19818403018152828252805160209182012090830152016040516020818303038152906040528051906020012090506107708484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f00000000000000000000000000000000000000000000000000000000000000009250859150610b789050565b61078d57604051630e8a459760e31b815260040160405180910390fd5b61079686610944565b91506107c66040518060400160405280600c81526020016b3132b732b334b1b4b0b93c9d60a11b81525087610ab2565b6107cf82610b8e565b6040518060800160405280876001600160a01b03168152602001868152602001600081526020016107fd4290565b90526000838152600160208181526040808420855181546001600160a01b0319166001600160a01b039182161782558684015182860155868301516002808401919091556060909701516003909201919091558b1684529390529190205490610867908290610d72565b6001600160a01b0388811660008181526002602081815260408084209690965588835260018082529286902086519485529084018c9052428487015260608401899052805490941660808401529083015460a083015282015460c082015260039091015460e082015290517ffa5982c664d9800dc3438e37ce1527e271030acc8f35e91c6345440227d33ec3918190036101000190a150505050505050565b61090e610afb565b6001600160a01b03811661093857604051631e4fbdf760e01b815260006004820152602401610605565b61094181610b28565b50565b6001600160a01b0381166000908152600260209081526040808320548151606086901b6bffffffffffffffffffffffff1916818501526034808201929092528251808203909201825260540190915280519101205b92915050565b6000818152600160208181526040808420815160808101835281546001600160a01b031681529381015492840192909252600282015490830152600301546060820181905282906109f09042610d5f565b602083015190915062ed4e00821015610a0e57506000949350505050565b62ed4e008210158015610a2457506301da9c0082105b15610a49576064610a36826019610da7565b610a409190610dbe565b95945050505050565b6301da9c008210158015610a605750630251430082105b15610a72576064610a36826032610da7565b63025143008210158015610a8957506302c7ea0082105b15610a9b576064610a3682604b610da7565b6302c7ea008210610308576064610a368282610da7565b610af78282604051602401610ac8929190610de0565b60408051601f198184030181529190526020810180516001600160e01b031663319af33360e01b179052610bcf565b5050565b6000546001600160a01b0316331461065f5760405163118cdaa760e01b8152336004820152602401610605565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082610b858584610bf0565b14949350505050565b61094181604051602401610ba491815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166327b7cf8560e01b1790525b80516a636f6e736f6c652e6c6f67602083016000808483855afa5050505050565b600081815b8451811015610c3557610c2182868381518110610c1457610c14610e40565b6020026020010151610c3d565b915080610c2d81610e56565b915050610bf5565b509392505050565b6000818310610c59576000828152602084905260409020610c68565b60008381526020839052604090205b9392505050565b600060208284031215610c8157600080fd5b5035919050565b80356001600160a01b0381168114610c9f57600080fd5b919050565b60008060008060608587031215610cba57600080fd5b610cc385610c88565b935060208501359250604085013567ffffffffffffffff80821115610ce757600080fd5b818701915087601f830112610cfb57600080fd5b813581811115610d0a57600080fd5b8860208260051b8501011115610d1f57600080fd5b95989497505060200194505050565b600060208284031215610d4057600080fd5b610c6882610c88565b634e487b7160e01b600052601160045260246000fd5b8181038181111561099957610999610d49565b8082018082111561099957610999610d49565b600060208284031215610d9757600080fd5b81518015158114610c6857600080fd5b808202811582820484141761099957610999610d49565b600082610ddb57634e487b7160e01b600052601260045260246000fd5b500490565b604081526000835180604084015260005b81811015610e0e5760208187018101516060868401015201610df1565b50600060608285018101919091526001600160a01b03949094166020840152601f01601f191690910190910192915050565b634e487b7160e01b600052603260045260246000fd5b600060018201610e6857610e68610d49565b506001019056fea2646970667358221220a994c29d43da8c587c1cfa1d6aaf9824e09b906e024c914cb7ad04b3973600d364736f6c63430008150033000000000000000000000000b041b040b350cc6bd75b38f94e6461cfc7c40135876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee", 38 | "nonce": "0xa9", 39 | "accessList": [] 40 | }, 41 | "additionalContracts": [], 42 | "isFixedGasLimit": false 43 | } 44 | ], 45 | "receipts": [], 46 | "libraries": [], 47 | "pending": [ 48 | "0xe278355c381ed4f1e8c9014c8c27b929b3d74cc1a3d3b2b09269df3ae931b76f", 49 | "0xbb0ad6a6ac35ec4966c12b4f6ba8d8df9a9281443b8cf4d58a86e5ca9ff2577e" 50 | ], 51 | "returns": { 52 | "0": { 53 | "internal_type": "contract PresaleTokenVesting", 54 | "value": "0xfDd00E9377e8121F72A4fe760Bb77f05d838EbF0" 55 | } 56 | }, 57 | "timestamp": 1707920559, 58 | "chain": 11155111, 59 | "multi": false, 60 | "commit": "7b65599" 61 | } -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options 7 | remappings=["@openzeppelin/contracts=lib/openzeppelin-contracts/contracts", 8 | "@chainlink/src/interfaces=lib/foundry-chainlink-toolkit/src/interfaces" 9 | ] 10 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xtoben22/BEM-token/54d4d72ed44739a3debc0b925be9c86c84c0919e/metadata.json -------------------------------------------------------------------------------- /script/DeployBemStaking.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.19; 3 | 4 | import {Script, console2} from "lib/forge-std/src/Script.sol"; 5 | import {BemToken} from "../src/Bem.sol"; 6 | import {BemPresale} from "../src/BemPresale.sol"; 7 | import {BemStaking} from "../src/BemStaking.sol"; 8 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 9 | 10 | contract DeployBemStaking is Script { 11 | function run() external returns (BemStaking) { 12 | vm.startBroadcast(); 13 | BemToken bemToken = new BemToken(); 14 | BemStaking bemStaking = new BemStaking( 15 | IERC20(bemToken), 16 | msg.sender, 17 | 10 18 | ); 19 | vm.stopBroadcast(); 20 | return bemStaking; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /script/DeployBemVesting.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.19; 3 | 4 | import {Script, console2} from "lib/forge-std/src/Script.sol"; 5 | import {BemToken} from "../src/Bem.sol"; 6 | import {BemPresale} from "../src/BemPresale.sol"; 7 | import {PresaleTokenVesting} from "../src/BemTokenVesting.sol"; 8 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 9 | 10 | contract DeployBemVesting is Script { 11 | function run() external returns (PresaleTokenVesting) { 12 | vm.startBroadcast(); 13 | BemToken bemToken = new BemToken(); 14 | // BemPresale bemPresale = new BemPresale( 15 | // 10 ether, 16 | // 0.0005 ether, 17 | // 0.009 ether, 18 | // IERC20(bemToken), 19 | // 0x3a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae 20 | // ); 21 | PresaleTokenVesting bemVesting = new PresaleTokenVesting( 22 | IERC20(bemToken), 23 | 0x876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee 24 | ); 25 | vm.stopBroadcast(); 26 | return bemVesting; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /script/deployBemPresale.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.19; 3 | 4 | import {Script, console2} from "lib/forge-std/src/Script.sol"; 5 | import {BemToken} from "../src/Bem.sol"; 6 | import {BemPresale} from "../src/BemPresale.sol"; 7 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 8 | 9 | contract DeployBemPresale is Script { 10 | function run() external returns (BemPresale) { 11 | vm.startBroadcast(); 12 | BemToken bemToken = new BemToken(); 13 | BemPresale bemPresale = new BemPresale( 14 | 10 ether, 15 | 0.0005 ether, 16 | 0.009 ether, 17 | IERC20(bemToken), 18 | 0x3a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae 19 | ); 20 | vm.stopBroadcast(); 21 | return bemPresale; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /script/deployBemToken.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.19; 3 | 4 | import {Script, console2} from "lib/forge-std/src/Script.sol"; 5 | import {BemToken} from "../src/Bem.sol"; 6 | 7 | contract DeployBemToken is Script { 8 | function run() external returns (BemToken) { 9 | vm.startBroadcast(); 10 | BemToken bemToken = new BemToken(); 11 | vm.stopBroadcast(); 12 | return bemToken; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/AnotherStakingContract.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier:MIT 2 | 3 | pragma solidity ^0.8.19; 4 | 5 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 6 | import "@openzeppelin/contracts/access/Ownable.sol"; 7 | import "./lib/FullMath.sol"; 8 | 9 | //Error 10 | error BMS__InsufficientStake(); 11 | error BMS__InvalidDuration(); 12 | error BMS__StakeFailed(); 13 | error BMS__WithdrawFailed(); 14 | error BMS__NotRewardsAvailable(); 15 | error BMS__InvalidStaker(); 16 | 17 | contract BemStaking { 18 | IERC20 public immutable tokenAddress; 19 | 20 | uint64 public minDuration = uint64(block.timestamp) + (3 * 30 days); 21 | uint64 public maxDuration = uint64(block.timestamp) + (2 * 365 days); 22 | uint256 public constant PRECISION = 1e30; 23 | 24 | uint256 public totalSupply; 25 | uint256 public rewardRate; 26 | uint256 public rewardPerTokenStored; 27 | uint64 public lastUpdateTime; 28 | 29 | //Mapping 30 | mapping(address => bool) public isStaker; 31 | mapping(address => uint256) public balanceOf; 32 | mapping(address => uint256) public stakeRewards; 33 | mapping(address => uint256) public userRewardPerTokenPaid; 34 | 35 | //Event 36 | event TokenStaked( 37 | address staker, 38 | uint256 amount, 39 | uint64 duration, 40 | uint256 rewardRate 41 | ); 42 | event TokenStakeWithdrawn(address staker, uint256 stakeAmount); 43 | event StakeYieldRedeemed(address staker, uint256 yield); 44 | 45 | //Modifier 46 | modifier hasStake() { 47 | if (!isStaker[msg.sender]) revert BMS__InvalidStaker(); 48 | _; 49 | } 50 | 51 | constructor(IERC20 _token) { 52 | tokenAddress = _token; 53 | } 54 | 55 | function stake(uint256 amount, uint64 duration) external { 56 | if (amount == 0) revert BMS__InsufficientStake(); 57 | if (duration < minDuration || duration > maxDuration) 58 | revert BMS__InvalidDuration(); 59 | 60 | uint256 userStakeBalance = balanceOf[msg.sender]; 61 | uint64 recentStakeDurationUpdate = getLatestStakeTimeFromStart(); 62 | uint256 _totalSupply = totalSupply; 63 | uint256 rewardPerToken = _getRewardPerToken( 64 | recentStakeDurationUpdate, 65 | _totalSupply 66 | ); 67 | rewardPerTokenStored = rewardPerToken; 68 | lastUpdateTime = recentStakeDurationUpdate; 69 | balanceOf[msg.sender] = userStakeBalance + amount; 70 | stakeRewards[msg.sender] = _earned( 71 | msg.sender, 72 | userStakeBalance, 73 | rewardPerToken, 74 | stakeRewards[msg.sender] 75 | ); 76 | userRewardPerTokenPaid[msg.sender] = rewardPerToken; 77 | 78 | totalSupply = _totalSupply + totalSupply; 79 | if (!tokenAddress.transferFrom(msg.sender, address(this), amount)) 80 | revert BMS__StakeFailed(); 81 | 82 | isStaker[msg.sender] = true; 83 | 84 | emit TokenStaked(msg.sender, amount, duration, rewardRate); 85 | } 86 | 87 | function withdraw(uint256 amount) external hasStake { 88 | if (amount == 0) revert BMS__InsufficientStake(); 89 | 90 | uint256 userStakeBalance = balanceOf[msg.sender]; 91 | uint64 recentStakeDurationUpdate = getLatestStakeTimeFromStart(); 92 | uint256 _totalSupply = totalSupply; 93 | 94 | uint256 rewardPerToken = _getRewardPerToken( 95 | recentStakeDurationUpdate, 96 | _totalSupply 97 | ); 98 | rewardPerTokenStored = rewardPerToken; 99 | 100 | lastUpdateTime = recentStakeDurationUpdate; 101 | 102 | stakeRewards[msg.sender] = _earned( 103 | msg.sender, 104 | userStakeBalance, 105 | rewardPerToken, 106 | stakeRewards[msg.sender] 107 | ); 108 | 109 | userRewardPerTokenPaid[msg.sender] = rewardPerToken; 110 | 111 | balanceOf[msg.sender] = userStakeBalance - amount; 112 | 113 | unchecked { 114 | totalSupply = _totalSupply - amount; 115 | } 116 | 117 | if (!tokenAddress.transferFrom(address(this), msg.sender, amount)) 118 | revert BMS__WithdrawFailed(); 119 | 120 | emit TokenStakeWithdrawn(msg.sender, amount); 121 | } 122 | 123 | function exit() public hasStake { 124 | uint256 stakeBalance = balanceOf[msg.sender]; 125 | 126 | uint64 recentStakeDurationUpdate = getLatestStakeTimeFromStart(); 127 | uint256 _totalSupply = totalSupply; 128 | uint256 rewardPerToken = _getRewardPerToken( 129 | recentStakeDurationUpdate, 130 | _totalSupply 131 | ); 132 | 133 | uint256 rewards = _earned( 134 | msg.sender, 135 | stakeBalance, 136 | rewardPerToken, 137 | stakeRewards[msg.sender] 138 | ); 139 | if (rewards > 0) { 140 | stakeRewards[msg.sender] = 0; 141 | } 142 | 143 | rewardPerTokenStored = rewardPerToken; 144 | lastUpdateTime = recentStakeDurationUpdate; 145 | userRewardPerTokenPaid[msg.sender] = rewardPerToken; 146 | 147 | balanceOf[msg.sender] = 0; 148 | 149 | tokenAddress.transferFrom(address(this), msg.sender, stakeBalance); 150 | emit TokenStakeWithdrawn(msg.sender, stakeBalance); 151 | 152 | unchecked { 153 | totalSupply = _totalSupply - stakeBalance; 154 | } 155 | if (rewards > 0) { 156 | tokenAddress.transferFrom(address(this), msg.sender, rewards); 157 | emit StakeYieldRedeemed(msg.sender, rewards); 158 | } 159 | } 160 | 161 | function getReward() external hasStake { 162 | uint256 stakeBalance = balanceOf[msg.sender]; 163 | uint256 _totalSupply = totalSupply; 164 | uint64 latestStakeDurationUpdate = getLatestStakeTimeFromStart(); 165 | uint256 rewardPerToken = _getRewardPerToken( 166 | latestStakeDurationUpdate, 167 | _totalSupply 168 | ); 169 | rewardPerTokenStored = rewardPerToken; 170 | lastUpdateTime = latestStakeDurationUpdate; 171 | uint256 rewards = _earned( 172 | msg.sender, 173 | stakeBalance, 174 | rewardPerToken, 175 | stakeRewards[msg.sender] 176 | ); 177 | if (rewards <= 0) { 178 | revert BMS__NotRewardsAvailable(); 179 | } else if (rewards > 0) { 180 | stakeRewards[msg.sender] = 0; 181 | } 182 | 183 | tokenAddress.transferFrom(address(this), msg.sender, rewards); 184 | } 185 | 186 | function getRewardPerToken() public view returns (uint256) { 187 | return _getRewardPerToken(getLatestStakeTimeFromStart(), totalSupply); 188 | } 189 | 190 | function earned(address staker) public view returns (uint256) { 191 | return 192 | _earned( 193 | staker, 194 | balanceOf[staker], 195 | _getRewardPerToken(getLatestStakeTimeFromStart(), totalSupply), 196 | stakeRewards[staker] 197 | ); 198 | } 199 | 200 | function _getRewardPerToken( 201 | uint64 latestStakeTimeFromStart, 202 | uint256 _totalSupply 203 | ) internal view returns (uint256) { 204 | if (_totalSupply == 0) { 205 | return rewardPerTokenStored; 206 | } 207 | return 208 | rewardPerTokenStored + 209 | FullMath.mulDiv(rewardRate, latestStakeTimeFromStart, _totalSupply); 210 | } 211 | 212 | function _earned( 213 | address account, 214 | uint256 userStakeAmount, 215 | uint256 rewardPerToken, 216 | uint256 prevRewards 217 | ) internal view returns (uint256) { 218 | return 219 | FullMath.mulDiv( 220 | userStakeAmount, 221 | rewardPerToken - userRewardPerTokenPaid[account], 222 | PRECISION 223 | ) + prevRewards; 224 | } 225 | 226 | function getLatestStakeTimeFromStart() private view returns (uint64) { 227 | if (block.timestamp < minDuration) { 228 | return minDuration; 229 | } else if ( 230 | block.timestamp < maxDuration && block.timestamp > minDuration 231 | ) { 232 | return maxDuration; 233 | } else { 234 | return uint64(block.timestamp); 235 | } 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /src/Bem.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier:MIT 2 | 3 | pragma solidity ^0.8.19; 4 | 5 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 6 | import "@openzeppelin/contracts/access/Ownable.sol"; 7 | 8 | contract BemToken is ERC20, Ownable { 9 | bytes32 public immutable i_merkleRoot; 10 | 11 | constructor() ERC20("BEM", "BM") Ownable(msg.sender) {} 12 | 13 | //Event 14 | event FirstMint(address owner, uint256 amount); 15 | event Burnt(address from, uint256 _supplyToBurn); 16 | event AirDrop(address source, address destination, uint256 _amount); 17 | event MonthlyEmission(address owner, uint256 emittedTokenNum); 18 | 19 | function initialMint(uint _amount) public onlyOwner { 20 | _mint(address(this), _amount); 21 | 22 | emit FirstMint(msg.sender, _amount); 23 | } 24 | 25 | function monthlyBurn(uint256 supplyToBurn) public onlyOwner { 26 | _burn(address(this), supplyToBurn); 27 | emit Burnt(address(this), supplyToBurn); 28 | } 29 | 30 | function dynamicEmission(uint256 monthlyEmissionRate) public { 31 | _mint(address(this), monthlyEmissionRate); 32 | 33 | emit MonthlyEmission(msg.sender, monthlyEmissionRate); 34 | } 35 | 36 | function externalTransfer(address payee, uint256 amount) public onlyOwner { 37 | transferFrom(address(this), payee, amount); 38 | } 39 | 40 | //Dynamic emission 41 | /** 42 | * 43 | *Mn+1= Amount of $ in use on the business month n+1 44 | * 45 | Tn+1 = Number of tokens available by the end of month N 46 | 47 | X = How many tokens we need to release in month n+1 in order to keep the value of the token as it was in month N. 48 | 49 | Vn = The value of the token in month N 50 | 51 | 52 | Mn+1 53 | ———— = Vn 54 | (Tn+1+X) 55 | 56 | X= (Mn+1- Vn • Tn+1) 57 | ——————————- 58 | Vn 59 | Mn = 100 60 | Tn = 10000 61 | Mn+1 = $120 62 | Tn+1 = 9000 ( 10% were burned) 63 | Vn =100/ 10000= .01 64 | 65 | X = (120 - 0.01 *9000) / 0.01 = 3000 66 | 67 | */ 68 | } 69 | -------------------------------------------------------------------------------- /src/BemPresale.sol: -------------------------------------------------------------------------------- 1 | // Layout of Contract: 2 | // version 3 | // imports 4 | // errors 5 | // interfaces, libraries, contracts 6 | // Type declarations 7 | // State variables 8 | // Events 9 | // Modifiers 10 | // Functions 11 | 12 | // Layout of Functions: 13 | // constructor 14 | // receive function (if exists) 15 | // fallback function (if exists) 16 | // external 17 | // public 18 | // internal 19 | // private 20 | // internal & private view & pure functions 21 | // external & public view & pure functions 22 | 23 | // SPDX-License-Identifier: MIT 24 | pragma solidity ^0.8.19; 25 | 26 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 27 | import "@openzeppelin/contracts/access/Ownable.sol"; 28 | import "@chainlink/src/interfaces/feeds/AggregatorV3Interface.sol"; 29 | import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; 30 | import "./lib/ABDKMath64x64.sol"; 31 | 32 | //Error 33 | error BEM__PresaleInactive(); 34 | error BEM__InvalidPurchaseAmount(); 35 | error BEM__PresaleCapExceeded(); 36 | error BEM__MaxAccumulationLimitExceeded(); 37 | error BEM__ZeroEtherToWithdraw(); 38 | error BEM__PresaleCapCantBeZero(); 39 | error BEM__MaxPurchaseCantBeZero(); 40 | error BEM__PurchaseCapCantBeZero(); 41 | error BEM__TokenNonExistent(); 42 | //Airdrop errors 43 | error BM__InvalidAddress(); 44 | error BM__InvalidAmount(); 45 | error BM_InvalidMerkleProof(); 46 | error BM__AirDropFailed(); 47 | 48 | /// @title BemPresale 49 | /// @notice This contract manages the presale of BEM tokens, allowing users to contribute ETH in exchange for BEM tokens. 50 | /// @dev The contract uses OpenZeppelin's IERC20 interface for ERC20 token interactions and Ownable for ownership management. 51 | /// Custom errors are defined for handling specific failure cases gracefully. 52 | 53 | contract BemPresale is Ownable { 54 | IERC20 private immutable _token; 55 | AggregatorV3Interface private priceFeed; 56 | 57 | bytes32 public immutable i_merkleRoot; 58 | 59 | uint256 public constant tokenPriceUsd = 0.0075 * 1e18; //$0.0075 60 | 61 | uint256 public immutable i_presaleCap; 62 | uint256 public immutable i_presaleMinPurchase; 63 | uint256 public immutable i_presaleMaxPurchase; 64 | 65 | bool public isPresaleActive; 66 | uint256 public presaleRaisedAmount; 67 | 68 | //mapping 69 | // Mapping to track ETH deposits by contributors. 70 | mapping(address => uint256) public saleDeposit; 71 | // Mapping to track the amount of BEM tokens allocated to each contributor. 72 | mapping(address => uint256) public addressToPresaleAmount; 73 | 74 | //Event 75 | /// @notice Emitted when a contribution is made to the presale. 76 | /// @param contributor The address of the contributor. 77 | /// @param amount The amount of ETH contributed. 78 | /// @param tokensAllocated The amount of BEM tokens allocated to the contributor. 79 | event PresaleContribution( 80 | address indexed contributor, 81 | uint256 amount, 82 | uint256 tokensAllocated 83 | ); 84 | /// @notice Emitted when tokens are withdrawn by the owner. 85 | /// @param _receiver The address receiving the tokens. 86 | /// @param _amount The amount of tokens withdrawn. 87 | event TokensWithdrawn(address _receiver, uint256 _amount); 88 | 89 | event AirDrop(address source, address destination, uint256 _amount); 90 | 91 | /// @dev Sets the initial conditions for the presale. 92 | /// @param presaleCap The maximum amount of ETH that can be raised. 93 | /// @param presaleMinPurchase The minimum contribution amount in ETH. 94 | /// @param presaleMaxPurchase The maximum contribution amount in ETH per contributor. 95 | /// @param tokenAddress The address of the BEM ERC20 token. 96 | constructor( 97 | uint256 presaleCap, 98 | uint256 presaleMinPurchase, 99 | uint256 presaleMaxPurchase, 100 | IERC20 tokenAddress, 101 | bytes32 merkleRoot 102 | ) Ownable(msg.sender) { 103 | if (presaleCap <= 0) revert BEM__PresaleCapCantBeZero(); 104 | if (presaleMaxPurchase <= 0 || presaleMaxPurchase <= 0) 105 | revert BEM__PurchaseCapCantBeZero(); 106 | if (address(tokenAddress) == address(0)) revert BEM__TokenNonExistent(); 107 | 108 | priceFeed = AggregatorV3Interface( 109 | 0x694AA1769357215DE4FAC081bf1f309aDC325306 110 | ); 111 | isPresaleActive = true; 112 | i_merkleRoot = merkleRoot; 113 | i_presaleCap = presaleCap; 114 | i_presaleMinPurchase = presaleMinPurchase; 115 | i_presaleMaxPurchase = presaleMaxPurchase; 116 | _token = tokenAddress; 117 | } 118 | 119 | /// @notice Allows contributors to send ETH and participate in the presale. 120 | /// @dev Reverts if the presale is inactive, the contribution is outside the allowed range, the presale cap is exceeded, or if the contributor has reached the max accumulation limit. 121 | function contributeToPresale() public payable { 122 | if (!isPresaleActive) revert BEM__PresaleInactive(); 123 | if (addressToPresaleAmount[msg.sender] >= i_presaleMaxPurchase) 124 | revert BEM__MaxAccumulationLimitExceeded(); 125 | if ( 126 | msg.value < i_presaleMinPurchase || msg.value > i_presaleMaxPurchase 127 | ) revert BEM__InvalidPurchaseAmount(); 128 | if (i_presaleCap == presaleRaisedAmount) 129 | revert BEM__PresaleCapExceeded(); 130 | 131 | uint256 ethDeposited = msg.value; //Deposit value in WEI 132 | int256 currentEthUSDPrice = getLatestEthUSDPrice(); //Latest price of ETH in USD with a scale of 1e8 133 | 134 | // uint256 usdValueForEthDeposit = ABDKMath64x64.mulu( //Using ABDKMath64x64 for high precision on calculation 135 | // ABDKMath64x64.divu(ethDeposited, 1e10), 136 | // uint256(currentEthUSDPrice) 137 | // ); 138 | // uint128 tokenAllocated = uint128( 139 | // ABDKMath64x64.divu((usdValueForEthDeposit * 1e18), tokenPriceUsd) 140 | // ); 141 | uint256 usdValueForEthDeposit = (ethDeposited * // Convert wei to USD scale 142 | uint256(currentEthUSDPrice)) / 1e18; 143 | 144 | saleDeposit[msg.sender] = ethDeposited; 145 | uint256 tokenAllocated = (usdValueForEthDeposit * 1e18) / tokenPriceUsd; 146 | presaleRaisedAmount += ethDeposited; 147 | addressToPresaleAmount[msg.sender] += tokenAllocated; 148 | 149 | emit PresaleContribution(msg.sender, msg.value, tokenAllocated); 150 | } 151 | 152 | /// @notice Allows the owner to pause the presale. 153 | /// @dev Can only be called by the contract owner. 154 | function pausePresale() public onlyOwner { 155 | isPresaleActive = false; 156 | } 157 | 158 | /// @notice Allows the owner to restart the presale. 159 | /// @dev Can only be called by the contract owner. 160 | function restartPresale() public onlyOwner { 161 | isPresaleActive = true; 162 | } 163 | 164 | /// @notice Allows the owner to withdraw ERC20 tokens from the contract. 165 | /// @param _receiver The address to which the tokens are sent. 166 | /// @param _amount The amount of tokens to withdraw. 167 | /// @dev Can only be called by the contract owner. 168 | function withdrawTokens( 169 | address _receiver, 170 | uint256 _amount 171 | ) public onlyOwner { 172 | require(_amount > 0, "Amount should be > 0"); 173 | 174 | _token.transfer(_receiver, _amount); 175 | emit TokensWithdrawn(_receiver, _amount); 176 | } 177 | 178 | /// @notice Allows the owner to withdraw the ETH raised during the presale. 179 | /// @dev Reverts if there are no ETH to withdraw. 180 | function withdrawDeposit() public onlyOwner { 181 | if (address(this).balance <= 0) revert BEM__ZeroEtherToWithdraw(); 182 | uint256 balance = address(this).balance; 183 | payable(owner()).transfer(balance); 184 | } 185 | 186 | /** 187 | * Gets the latest ETH/USD value using Chainlink's pricefeeds... 188 | */ 189 | function getLatestEthUSDPrice() public view returns (int) { 190 | (, int256 price, , , ) = priceFeed.latestRoundData(); 191 | return price; 192 | } 193 | 194 | //AirDrop 195 | function claimAirdrop( 196 | bytes32[] calldata merkleProof, 197 | address user, 198 | uint256 _tokenAmount 199 | ) public onlyOwner { 200 | if (address(user) == address(0)) revert BM__InvalidAddress(); 201 | if (_tokenAmount <= 0) revert BM__InvalidAmount(); 202 | 203 | bytes32 leaf = keccak256( 204 | bytes.concat(keccak256(abi.encode(user, _tokenAmount))) 205 | ); 206 | _token.approve(address(this), _tokenAmount); 207 | if (!MerkleProof.verify(merkleProof, i_merkleRoot, leaf)) 208 | revert BM_InvalidMerkleProof(); 209 | 210 | if (!_token.transferFrom(address(this), user, _tokenAmount)) 211 | revert BM__AirDropFailed(); 212 | 213 | emit AirDrop(address(this), user, _tokenAmount); 214 | } 215 | } 216 | /** 217 | * constructor( 218 | uint256 219 | uint256 220 | uint256 221 | IERC20 222 | bytes32 223 | ) 224 | */ 225 | -------------------------------------------------------------------------------- /src/BemStaking.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier:MIT 2 | 3 | pragma solidity ^0.8.19; 4 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 5 | import "@openzeppelin/contracts/access/AccessControl.sol"; 6 | import "./lib/ABDKMath64x64.sol"; 7 | import "forge-std/console.sol"; 8 | 9 | //Error 10 | error BMS__InsufficientStake(); 11 | error BMS__InvalidDuration(); 12 | error BMS_InsufficientBalance(); 13 | error BMS__StakeFailed(); 14 | error BMS__WithdrawFailed(); 15 | error BMS__NoRewardsAvailable(); 16 | error BMS__InvalidStaker(); 17 | error BMS__StakingPeriodNotOver(); 18 | error BMS__NoStakeAvailable(); 19 | error BMS__StakingInactive(); 20 | error BMS__AlreadyPaused(); 21 | error BMS__StakingAlreadyActive(); 22 | error BMS__StakingPeriodOverTryWithdrawal(); 23 | error BMS__StakeExitFailed(); 24 | 25 | /** 26 | * @title BemStaking 27 | * @notice This contract implements a staking mechanism for an ERC20 token. Users can stake tokens for a specified duration and earn rewards based on the staking period. 28 | * @dev Inherits from OpenZeppelin's AccessControl for role management. Utilizes ABDKMath64x64 for high precision arithmetic operations. 29 | */ 30 | contract BemStaking is AccessControl { 31 | IERC20 public immutable tokenAddress; // Address of the ERC20 token being staked. 32 | uint256 public totalSupply; // Total supply of staked tokens. 33 | uint256 public immutable i_rewardRate; // Immutable reward rate for staking calculations. 34 | bool public isActive = true; // Flag to indicate if staking is active. 35 | 36 | uint64 public MIN_DURATION = 3 * 30 days; // Minimum staking duration. 37 | uint64 public MAX_DURATION = 2 * 365 days; // Maximum staking duration. 38 | bytes32 public constant STAKER_ADMIN = keccak256("STAKER_ADMIN"); // Role for staking admin. 39 | // Struct to store information about each stake. 40 | struct StakeInfo { 41 | uint256 stakeAmount; // Amount of tokens staked. 42 | uint64 duration; // Duration of the stake. 43 | uint256 stakeBegan; // Timestamp when the stake began. 44 | } 45 | // Mapping from staker's address to their stake count and from stake count to their StakeInfo. 46 | mapping(address => uint32) public stakeCounts; 47 | mapping(address => mapping(uint32 => StakeInfo)) public stakerInfo; 48 | mapping(address => bool) public isStaker; // Mapping to check if an address has staked tokens. 49 | 50 | //Event 51 | event TokenStaked( 52 | address staker, 53 | uint256 amount, 54 | uint64 stakeBegan, 55 | uint64 duration, 56 | uint32 _counter, 57 | StakeInfo stakeInfo 58 | ); 59 | event StakeYieldRedeemed(address staker, uint256 rewards, uint32 index); 60 | event StakerExited(address staker, uint _amount, StakeInfo stakeInfo); 61 | 62 | //Modifier 63 | modifier hasStake() { 64 | if (!isStaker[msg.sender]) revert BMS__InvalidStaker(); 65 | _; 66 | } 67 | modifier stakingIsActive() { 68 | if (!isActive) revert BMS__StakingInactive(); 69 | _; 70 | } 71 | 72 | /** 73 | * @notice Constructor to initialize the staking contract with the token to be staked and the admin role. 74 | * @param _token Address of the ERC20 token to be staked. 75 | * @param stakerAdmin Address to be granted the STAKER_ADMIN role. 76 | * @param rewardRate Annual reward rate for calculating staking rewards. 77 | */ 78 | constructor(IERC20 _token, address stakerAdmin, uint256 rewardRate) { 79 | tokenAddress = _token; 80 | i_rewardRate = rewardRate; 81 | _grantRole(STAKER_ADMIN, stakerAdmin); 82 | _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); 83 | } 84 | 85 | /** 86 | * @notice Allows users to stake tokens for a specified duration. 87 | * @param _amount Amount of tokens to stake. 88 | * @param _duration Duration for which the tokens are to be staked. 89 | * @dev Emits a TokenStaked event on successful staking. 90 | */ 91 | function stake(uint256 _amount, uint64 _duration) public stakingIsActive { 92 | if (_amount == 0) revert BMS__InsufficientStake(); 93 | if (_duration < MIN_DURATION || _duration > MAX_DURATION) 94 | revert BMS__InvalidDuration(); 95 | if (tokenAddress.balanceOf(msg.sender) < _amount) 96 | revert BMS_InsufficientBalance(); 97 | 98 | uint32 stakeCount = stakeCounts[msg.sender]; 99 | StakeInfo memory stakeInfo = StakeInfo( 100 | _amount, 101 | _duration, 102 | block.timestamp 103 | ); 104 | console.log("stakeBegan:", stakeInfo.stakeBegan); 105 | stakerInfo[msg.sender][stakeCount] = stakeInfo; 106 | stakeCounts[msg.sender] = stakeCount + 1; 107 | stakeCount++; 108 | if (!tokenAddress.transferFrom(msg.sender, address(this), _amount)) 109 | revert BMS__StakeFailed(); 110 | totalSupply += _amount; 111 | isStaker[msg.sender] = true; 112 | 113 | emit TokenStaked( 114 | msg.sender, 115 | _amount, 116 | uint64(block.timestamp), 117 | _duration, 118 | stakeCount, 119 | stakeInfo 120 | ); 121 | } 122 | 123 | /** 124 | * @notice Allows a staker to exit staking by withdrawing their staked tokens. 125 | * @dev Emits a StakerExited event on successful withdrawal of staked tokens. 126 | * This function checks that the caller has an active stake, verifies if the staking period 127 | * has ended, and then transfers the staked amount back to the caller. The staked amount is 128 | * then reset to 0 to prevent re-entrancy or duplicate withdrawals. 129 | * 130 | * Requirements: 131 | * - The caller must have an active stake. 132 | * - The staking period for the latest stake must be over. 133 | * 134 | * @custom:modifier hasStake Ensures the caller has an active stake. 135 | */ 136 | function exit() external hasStake { 137 | uint32 index = stakeCounts[msg.sender]; 138 | StakeInfo memory exitInfo = stakerInfo[msg.sender][index]; 139 | if (exitInfo.stakeAmount > 0) revert BMS__NoStakeAvailable(); 140 | if (block.timestamp > exitInfo.duration) 141 | revert BMS__StakingPeriodOverTryWithdrawal(); 142 | 143 | uint256 exitAmount = exitInfo.stakeAmount; 144 | exitInfo.stakeAmount = 0; 145 | // exitInfo.duration = 0; 146 | // exitInfo.stakeBegan = 0; 147 | exitInfo = StakeInfo(0, 0, 0); 148 | if (!tokenAddress.transferFrom(address(this), msg.sender, exitAmount)) 149 | revert BMS__StakeExitFailed(); 150 | emit StakerExited(msg.sender, exitAmount, exitInfo); 151 | } 152 | 153 | /** 154 | * @notice Allows a staker to withdraw their rewards after the staking period is over. 155 | * @dev Emits a StakeYieldRedeemed event on successful withdrawal of rewards. 156 | * This function checks if the staking period for the caller's latest stake has ended, 157 | * calculates the rewards using `_getStakeRewards`, and transfers the rewards to the caller. 158 | * It then resets the stake start time to allow for recalculating rewards for subsequent periods. 159 | */ 160 | function withdraw() public hasStake { 161 | uint32 index = stakeCounts[msg.sender]; 162 | StakeInfo memory currentStaker = stakerInfo[msg.sender][index]; 163 | if (block.timestamp - currentStaker.stakeBegan < currentStaker.duration) 164 | revert BMS__StakingPeriodNotOver(); 165 | 166 | uint256 rewards = _getStakeRewards(); 167 | if (rewards <= 0) revert BMS__NoRewardsAvailable(); 168 | currentStaker.stakeBegan = uint64(block.timestamp); 169 | if (!tokenAddress.transferFrom(msg.sender, address(this), rewards)) 170 | revert BMS__WithdrawFailed(); 171 | 172 | emit StakeYieldRedeemed(msg.sender, rewards, index); 173 | } 174 | 175 | /** 176 | * @notice Pauses the staking functionality, preventing new stakes. 177 | * @dev Can only be called by an account with the STAKER_ADMIN role. 178 | * @return bool Returns true if staking is successfully paused. 179 | */ 180 | function pauseStaking() public onlyRole(STAKER_ADMIN) returns (bool) { 181 | if (!isActive) revert BMS__AlreadyPaused(); 182 | isActive = false; 183 | return isActive; 184 | } 185 | 186 | /** 187 | * @notice Restarts the staking functionality, allowing new stakes. 188 | * @dev Can only be called by an account with the STAKER_ADMIN role. 189 | * @return bool Returns true if staking is successfully restarted. 190 | */ 191 | function restartStaking() public onlyRole(STAKER_ADMIN) returns (bool) { 192 | if (isActive) revert BMS__StakingAlreadyActive(); 193 | isActive = false; 194 | return isActive; 195 | } 196 | 197 | /** 198 | * @notice Grants the STAKER_ADMIN role to a specified account. 199 | * @param admin The address to be granted the STAKER_ADMIN role. 200 | * @dev Can only be called by an account with the DEFAULT_ADMIN_ROLE. 201 | */ 202 | function grantStakeAdminRole( 203 | address admin 204 | ) external onlyRole(DEFAULT_ADMIN_ROLE) { 205 | _grantRole(STAKER_ADMIN, admin); 206 | } 207 | 208 | /** 209 | * @notice Revokes the STAKER_ADMIN role from a specified account. 210 | * @param _admin The address from which the STAKER_ADMIN role will be revoked. 211 | * @dev Can only be called by an account with the DEFAULT_ADMIN_ROLE. 212 | */ 213 | function revokeStakeAdminRole( 214 | address _admin 215 | ) external onlyRole(DEFAULT_ADMIN_ROLE) { 216 | _grantRole(STAKER_ADMIN, _admin); 217 | } 218 | 219 | /** 220 | * @notice Calculates and returns the staking rewards for a staker. 221 | * @return uint256 The calculated staking rewards. 222 | * @dev Uses ABDKMath64x64 library for precise calculation of compounding rewards. 223 | */ 224 | function _getStakeRewards() internal view returns (uint256) { 225 | uint32 index = stakeCounts[msg.sender]; 226 | StakeInfo memory thisStake = stakerInfo[msg.sender][index]; 227 | if (block.timestamp < (thisStake.stakeBegan + thisStake.duration)) { 228 | return 0; 229 | } 230 | uint256 stakingDuration = uint64(block.timestamp) - 231 | thisStake.stakeBegan; 232 | if (stakingDuration > 0 && i_rewardRate > 0) { 233 | int128 compoundingFactor = ABDKMath64x64.pow( 234 | ABDKMath64x64.add( 235 | ABDKMath64x64.fromUInt(1), 236 | ABDKMath64x64.div( 237 | ABDKMath64x64.fromUInt(i_rewardRate), 238 | ABDKMath64x64.fromUInt(365) 239 | ) 240 | ), 241 | stakingDuration / 1 days 242 | ); 243 | return 244 | ABDKMath64x64.mulu(compoundingFactor, thisStake.stakeAmount) - 245 | thisStake.stakeAmount; 246 | } 247 | return 0; 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /src/BemTokenVesting.sol: -------------------------------------------------------------------------------- 1 | // Layout of Contract: 2 | // version 3 | // imports 4 | // errors 5 | // interfaces, libraries, contracts 6 | // Type declarations 7 | // State variables 8 | // Events 9 | // Modifiers 10 | // Functions 11 | 12 | // Layout of Functions: 13 | // constructor 14 | // receive function (if exists) 15 | // fallback function (if exists) 16 | // external 17 | // public 18 | // internal 19 | // private 20 | // internal & private view & pure functions 21 | // external & public view & pure functions 22 | //anvil --fork-url https://eth-sepolia.g.alchemy.com/v2/fWr3m1Bq4Mqxz0n-WoE86aq24VsXTsrq 23 | 24 | // SPDX-License-Identifier: MIT 25 | pragma solidity ^0.8.19; 26 | 27 | import "forge-std/console.sol"; 28 | 29 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 30 | import "@openzeppelin/contracts/access/Ownable.sol"; 31 | import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; 32 | 33 | // Custom errors for specific failure cases 34 | error BTV__InSufficientTokenToVest(); 35 | error BTV__VestingAlreadySet(); 36 | error BTV__InvalidMerkleProof(); 37 | error BTV__NotOwnerOrReleasor(); 38 | error BTV__NoTokenToVest(); 39 | error BTV__AlreadyClaimed(); 40 | error BTV__NothingToRelease(); 41 | error BTV__TokenNonExistent(); 42 | 43 | /// @title Presale Token Vesting 44 | /// @notice Manages the vesting of tokens purchased during a presale event, based on predefined vesting schedules. 45 | /// @dev Utilizes Merkle Proofs for initial allocation validation, ensuring participants' allocations match the presale terms. 46 | contract PresaleTokenVesting is Ownable { 47 | IERC20 private immutable _token; 48 | 49 | bytes32 public immutable i_merkleRoot; // Root hash of the Merkle tree used to validate vesting proofs. 50 | 51 | // Constants defining the vesting schedule parameters. 52 | uint256 public constant VESTING_DURATION = 2 * 365 days; // Total duration of the vesting period. 53 | uint256 public constant FIRST_UNLOCK = 6 * 30 days; // Duration until the first unlock of tokens. 54 | uint256 public constant SECOND_UNLOCK = 12 * 30 days; // Duration until the second unlock of tokens. 55 | uint256 public constant THIRD_UNLOCK = 15 * 30 days; // Duration until the third unlock of tokens. 56 | uint256 public constant FOURTH_UNLOCK = 18 * 30 days; // Duration until the fourth and final unlock of tokens. 57 | 58 | struct VestingInfo { 59 | address beneficiary; // Address of the beneficiary who is entitled to the tokens. 60 | uint256 totalAmount; // Total amount of tokens allocated for vesting to the beneficiary. 61 | uint256 amountReleased; // Amount of tokens that have been released to the beneficiary so far. 62 | uint256 vestingStart; // Timestamp when the vesting period starts. 63 | } 64 | 65 | mapping(bytes32 => VestingInfo) public vestingInformation; 66 | mapping(address => uint256) private holdersVestingCount; 67 | 68 | /// @notice Emitted when tokens are released to a beneficiary 69 | event TokensReleased(address beneficiary, uint256 amount); 70 | 71 | /// @notice Emitted when a new vesting schedule is created 72 | event VestCreated( 73 | address holder, 74 | uint256 amount, 75 | uint256 vestStartTime, 76 | bytes32 vetsingScheduleId, 77 | VestingInfo initialVest 78 | ); 79 | 80 | /// @dev Sets the token contract and the merkle root used for vesting verification 81 | /// @param tokenAddress The ERC20 token contract address 82 | /// @param merkleRoot The root hash of the Merkle tree used for allocation verification 83 | constructor(IERC20 tokenAddress, bytes32 merkleRoot) Ownable(msg.sender) { 84 | if (address(tokenAddress) == address(0)) revert BTV__TokenNonExistent(); 85 | _token = tokenAddress; 86 | i_merkleRoot = merkleRoot; 87 | } 88 | 89 | /// @notice Sets up a vesting schedule for a beneficiary using a Merkle Proof for verification 90 | /// @param _beneficiary The address of the beneficiary to receive the vested tokens 91 | /// @param totalAmount The total amount of tokens to be vested 92 | /// @param merkleProof The Merkle Proof verifying the allocation 93 | /// @dev Only the owner can set up a vesting schedule 94 | function setVesting( 95 | address _beneficiary, 96 | uint256 totalAmount, 97 | bytes32[] calldata merkleProof 98 | ) external onlyOwner { 99 | bytes32 vestingScheduleId; 100 | if (totalAmount <= 0) revert BTV__InSufficientTokenToVest(); 101 | if (vestingInformation[vestingScheduleId].totalAmount != 0) 102 | revert BTV__VestingAlreadySet(); 103 | 104 | // Compute the leaf node by hashing the beneficiary and total amount 105 | bytes32 leaf = keccak256( 106 | bytes.concat(keccak256(abi.encode(_beneficiary, totalAmount))) 107 | ); 108 | 109 | // Verify the provided Merkle Proof against the stored Merkle Root 110 | if (!MerkleProof.verify(merkleProof, i_merkleRoot, leaf)) 111 | revert BTV__InvalidMerkleProof(); 112 | 113 | vestingScheduleId = computeVestingScheduleIdForHolder(_beneficiary); 114 | console.log("beneficiary:", _beneficiary); 115 | console.logBytes32(vestingScheduleId); 116 | vestingInformation[vestingScheduleId] = VestingInfo( 117 | _beneficiary, 118 | totalAmount, 119 | 0, 120 | getCurrentTime() 121 | ); 122 | uint256 vestCount = holdersVestingCount[_beneficiary]; 123 | holdersVestingCount[_beneficiary] = vestCount + 1; 124 | 125 | emit VestCreated( 126 | _beneficiary, 127 | totalAmount, 128 | getCurrentTime(), 129 | vestingScheduleId, 130 | vestingInformation[vestingScheduleId] 131 | ); 132 | } 133 | 134 | /// @dev Computes a unique identifier for a vesting schedule based on the beneficiary's address and their vest count 135 | function computeVestingScheduleIdForHolder( 136 | address _beneficiary 137 | ) public view returns (bytes32) { 138 | return 139 | computeVestingScheduleIdForAddressNIndex( 140 | _beneficiary, 141 | holdersVestingCount[_beneficiary] 142 | ); 143 | } 144 | 145 | /// @dev Generates a unique identifier for a vesting schedule using the beneficiary's address and a specific index 146 | function computeVestingScheduleIdForAddressNIndex( 147 | address holder, 148 | uint256 index 149 | ) internal pure returns (bytes32) { 150 | return keccak256(abi.encodePacked(holder, index)); 151 | } 152 | 153 | /// @notice Releases vested tokens to the beneficiary 154 | /// @param vestScheduleId The unique identifier of the vesting schedule 155 | /// @dev Can be called by the beneficiary or the owner 156 | function release(bytes32 vestScheduleId) external { 157 | console.log("releaseCaller:", msg.sender); 158 | bool isHolder = msg.sender == 159 | vestingInformation[vestScheduleId].beneficiary; 160 | // bool isReleasor = (msg.sender == owner()); 161 | if (!isHolder) revert BTV__NotOwnerOrReleasor(); 162 | 163 | VestingInfo storage vesting = vestingInformation[vestScheduleId]; 164 | if (vesting.totalAmount <= 0) revert BTV__NoTokenToVest(); 165 | if (vesting.totalAmount == vesting.amountReleased) 166 | revert BTV__AlreadyClaimed(); 167 | 168 | uint256 unreleased = releasableAmount(vestScheduleId); 169 | if (unreleased <= 0) revert BTV__NothingToRelease(); 170 | 171 | vesting.amountReleased += unreleased; 172 | _token.approve(address(this), unreleased); 173 | require( 174 | _token.transferFrom(address(this), msg.sender, unreleased), 175 | "Token release failed" 176 | ); 177 | 178 | emit TokensReleased(msg.sender, unreleased); 179 | } 180 | 181 | /// @dev Calculates the amount of tokens that can be released from vesting 182 | function releasableAmount( 183 | bytes32 vestingScheduleId 184 | ) public view returns (uint256) { 185 | VestingInfo memory vesting = vestingInformation[vestingScheduleId]; 186 | uint256 totalVested = vestedAmount(vestingScheduleId); 187 | return totalVested - vesting.amountReleased; 188 | } 189 | 190 | /// @dev Determines the amount of vested token to unlock to the pre-sale contributor based on the current time and the vesting schedule 191 | function vestedAmount( 192 | bytes32 vestingScheduleId 193 | ) internal view returns (uint256) { 194 | VestingInfo memory vesting = vestingInformation[vestingScheduleId]; 195 | uint256 elapsedTime = getCurrentTime() - vesting.vestingStart; 196 | uint256 totalAmount = vesting.totalAmount; 197 | 198 | if (elapsedTime < FIRST_UNLOCK) { 199 | return 0; // No tokens are unlocked in the first 6 months 200 | } else if (elapsedTime >= FIRST_UNLOCK && elapsedTime < SECOND_UNLOCK) { 201 | return (totalAmount * 25) / 100; // 25% unlocked after 6 months 202 | } else if (elapsedTime >= SECOND_UNLOCK && elapsedTime < THIRD_UNLOCK) { 203 | return (totalAmount * 50) / 100; // An additional 25% unlocked after 12 months, making 50% in total 204 | } else if (elapsedTime >= THIRD_UNLOCK && elapsedTime < FOURTH_UNLOCK) { 205 | return (totalAmount * 75) / 100; // Another 25% unlocked after 15 months, making 75% in total 206 | } else if (elapsedTime >= FOURTH_UNLOCK) { 207 | return (totalAmount * 100) / 100; // Final 25% unlocked after 18 months, making 100% in total 208 | } else { 209 | return totalAmount; // Fallback to total amount if above conditions are not met 210 | } 211 | } 212 | 213 | /// @dev Utility function to obtain the current block timestamp 214 | function getCurrentTime() internal view virtual returns (uint256) { 215 | return block.timestamp; 216 | } 217 | 218 | function getVestingInfo( 219 | bytes32 vestingScheduleId 220 | ) external view returns (VestingInfo memory) { 221 | return vestingInformation[vestingScheduleId]; 222 | } 223 | } 224 | 225 | /** 226 | * function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { 227 | require(tokenAddress != address(_token), "Cannot recover vested tokens"); 228 | 229 | uint256 recoverableAmount = IERC20(tokenAddress).balanceOf(address(this)); 230 | require(tokenAmount <= recoverableAmount, "Insufficient recoverable amount"); 231 | 232 | IERC20(tokenAddress).transfer(msg.sender, tokenAmount); 233 | 234 | emit RecoveredERC20(tokenAddress, tokenAmount); 235 | } 236 | */ 237 | -------------------------------------------------------------------------------- /src/lib/FullMath.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | /// @title Contains 512-bit math functions 5 | /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision 6 | /// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits 7 | library FullMath { 8 | /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 9 | /// @param a The multiplicand 10 | /// @param b The multiplier 11 | /// @param denominator The divisor 12 | /// @return result The 256-bit result 13 | /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv 14 | function mulDiv( 15 | uint256 a, 16 | uint256 b, 17 | uint256 denominator 18 | ) internal pure returns (uint256 result) { 19 | unchecked { 20 | // 512-bit multiply [prod1 prod0] = a * b 21 | // Compute the product mod 2**256 and mod 2**256 - 1 22 | // then use the Chinese Remainder Theorem to reconstruct 23 | // the 512 bit result. The result is stored in two 256 24 | // variables such that product = prod1 * 2**256 + prod0 25 | uint256 prod0; // Least significant 256 bits of the product 26 | uint256 prod1; // Most significant 256 bits of the product 27 | assembly { 28 | let mm := mulmod(a, b, not(0)) 29 | prod0 := mul(a, b) 30 | prod1 := sub(sub(mm, prod0), lt(mm, prod0)) 31 | } 32 | 33 | // Handle non-overflow cases, 256 by 256 division 34 | if (prod1 == 0) { 35 | require(denominator > 0); 36 | assembly { 37 | result := div(prod0, denominator) 38 | } 39 | return result; 40 | } 41 | 42 | // Make sure the result is less than 2**256. 43 | // Also prevents denominator == 0 44 | require(denominator > prod1); 45 | 46 | /////////////////////////////////////////////// 47 | // 512 by 256 division. 48 | /////////////////////////////////////////////// 49 | 50 | // Make division exact by subtracting the remainder from [prod1 prod0] 51 | // Compute remainder using mulmod 52 | uint256 remainder; 53 | assembly { 54 | remainder := mulmod(a, b, denominator) 55 | } 56 | // Subtract 256 bit number from 512 bit number 57 | assembly { 58 | prod1 := sub(prod1, gt(remainder, prod0)) 59 | prod0 := sub(prod0, remainder) 60 | } 61 | 62 | // Factor powers of two out of denominator 63 | // Compute largest power of two divisor of denominator. 64 | // Always >= 1. 65 | uint256 twos = (type(uint256).max - denominator + 1) & denominator; 66 | // Divide denominator by power of two 67 | assembly { 68 | denominator := div(denominator, twos) 69 | } 70 | 71 | // Divide [prod1 prod0] by the factors of two 72 | assembly { 73 | prod0 := div(prod0, twos) 74 | } 75 | // Shift in bits from prod1 into prod0. For this we need 76 | // to flip `twos` such that it is 2**256 / twos. 77 | // If twos is zero, then it becomes one 78 | assembly { 79 | twos := add(div(sub(0, twos), twos), 1) 80 | } 81 | prod0 |= prod1 * twos; 82 | 83 | // Invert denominator mod 2**256 84 | // Now that denominator is an odd number, it has an inverse 85 | // modulo 2**256 such that denominator * inv = 1 mod 2**256. 86 | // Compute the inverse by starting with a seed that is correct 87 | // correct for four bits. That is, denominator * inv = 1 mod 2**4 88 | uint256 inv = (3 * denominator) ^ 2; 89 | // Now use Newton-Raphson iteration to improve the precision. 90 | // Thanks to Hensel's lifting lemma, this also works in modular 91 | // arithmetic, doubling the correct bits in each step. 92 | inv *= 2 - denominator * inv; // inverse mod 2**8 93 | inv *= 2 - denominator * inv; // inverse mod 2**16 94 | inv *= 2 - denominator * inv; // inverse mod 2**32 95 | inv *= 2 - denominator * inv; // inverse mod 2**64 96 | inv *= 2 - denominator * inv; // inverse mod 2**128 97 | inv *= 2 - denominator * inv; // inverse mod 2**256 98 | 99 | // Because the division is now exact we can divide by multiplying 100 | // with the modular inverse of denominator. This will give us the 101 | // correct result modulo 2**256. Since the precoditions guarantee 102 | // that the outcome is less than 2**256, this is the final result. 103 | // We don't need to compute the high bits of the result and prod1 104 | // is no longer required. 105 | result = prod0 * inv; 106 | return result; 107 | } 108 | } 109 | 110 | /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 111 | /// @param a The multiplicand 112 | /// @param b The multiplier 113 | /// @param denominator The divisor 114 | /// @return result The 256-bit result 115 | function mulDivRoundingUp( 116 | uint256 a, 117 | uint256 b, 118 | uint256 denominator 119 | ) internal pure returns (uint256 result) { 120 | result = mulDiv(a, b, denominator); 121 | unchecked { 122 | if (mulmod(a, b, denominator) > 0) { 123 | require(result < type(uint256).max); 124 | result++; 125 | } 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /test/BemStakingTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.19; 4 | 5 | import "forge-std/Test.sol"; 6 | import "../src/Bem.sol"; 7 | import "../src/BemStaking.sol"; 8 | 9 | contract BemStakingTest is Test { 10 | BemToken bem; 11 | BemStaking bemStaking; 12 | address user1 = makeAddr("user1"); 13 | address user2 = makeAddr("user2"); 14 | uint64 public MIN_DURATION = 3 * 30 days; 15 | uint64 public MAX_DURATION = 2 * 365 days; 16 | uint256 initialStake = 5000000000000000000000; 17 | 18 | function setUp() public { 19 | bem = new BemToken(); 20 | bem.initialMint(1000000000000000000000000000); 21 | bemStaking = new BemStaking(IERC20(bem), address(this), 10); 22 | vm.prank(address(bem)); 23 | bem.approve(address(this), 1000000000000000000000000); 24 | bem.externalTransfer(address(bemStaking), 100000000000000000000000); 25 | bem.externalTransfer(user1, 10000000000000000000000); 26 | bem.externalTransfer(user2, 20000000000000000000000); 27 | vm.prank(user1); 28 | bem.approve(address(bemStaking), 10000000000000000000000); 29 | vm.prank(user2); 30 | bem.approve(address(bemStaking), 20000000000000000000000); 31 | 32 | // console.logBool(bemStaking.isActive); 33 | console.logBool(bemStaking.isActive()); 34 | } 35 | 36 | function testStakeFunction() public { 37 | vm.startPrank(user1); 38 | bemStaking.stake(10000000000000000000000, MIN_DURATION); 39 | assertEqUint(bemStaking.totalSupply(), 10000000000000000000000); 40 | vm.stopPrank(); 41 | 42 | vm.startPrank(user2); 43 | bemStaking.stake(10000000000000000000000, MIN_DURATION); 44 | vm.stopPrank(); 45 | } 46 | 47 | function testStakeInvalidAmount() public { 48 | bytes4 customError = bytes4(keccak256("BMS__InsufficientStake()")); 49 | vm.expectRevert(customError); 50 | vm.prank(user1); 51 | bemStaking.stake(0, MIN_DURATION); 52 | } 53 | 54 | function testStakeInvalidDuration() public { 55 | bytes4 customError = bytes4(keccak256("BMS__InvalidDuration()")); 56 | vm.expectRevert(customError); 57 | vm.prank(user1); 58 | bemStaking.stake(initialStake, 2 days); // Less than MIN_DURATION 59 | } 60 | 61 | function testWithdrawBeforeDurationEnds() public { 62 | vm.startPrank(user1); 63 | bemStaking.stake(initialStake, MAX_DURATION); 64 | bytes4 customError = bytes4(keccak256("BMS__StakingPeriodNotOver()")); 65 | vm.expectRevert(customError); 66 | bemStaking.withdraw(); 67 | vm.stopPrank(); 68 | } 69 | 70 | function testStakingPauseAndRestart() public { 71 | // Pause staking 72 | bemStaking.pauseStaking(); 73 | vm.expectRevert(BMS__StakingInactive.selector); 74 | vm.prank(user1); 75 | bemStaking.stake(initialStake, MIN_DURATION); 76 | 77 | // Restart staking 78 | bemStaking.restartStaking(); 79 | vm.prank(user1); 80 | bemStaking.stake(initialStake, MIN_DURATION); // Should succeed now 81 | } 82 | 83 | function testStakeAndExit() public { 84 | vm.prank(user1); 85 | bemStaking.stake(initialStake, MIN_DURATION); 86 | uint256 balanceBeforeExit = bem.balanceOf(user1); 87 | 88 | // Fast forward time to after the staking duration 89 | vm.warp(block.timestamp + MIN_DURATION + 1); 90 | 91 | vm.prank(user1); 92 | bemStaking.exit(); 93 | 94 | uint256 balanceAfterExit = bem.balanceOf(user1); 95 | assertEq(balanceAfterExit, balanceBeforeExit + initialStake); // User gets their stake back 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /test/BemVestingTest.t.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier:MIT 2 | 3 | pragma solidity ^0.8.19; 4 | 5 | import "forge-std/Test.sol"; 6 | import "forge-std/console.sol"; 7 | 8 | //contract 9 | import "../src/Bem.sol"; 10 | import "../src/BemPresale.sol"; 11 | import "../src/BemTokenVesting.sol"; 12 | 13 | contract BemVestingTest is Test { 14 | BemToken bemToken; 15 | BemPresale bemPresale; 16 | PresaleTokenVesting bemVesting; 17 | bytes32 merkleRoot = 18 | 0x876ae3d088f6a906995a595a1fafcded051dc6ab0aad53df87e9c8543b7a32ee; 19 | bytes32 adMerkleRoot; 20 | 21 | address user1 = makeAddr("user1"); 22 | address user2 = makeAddr("user2"); 23 | 24 | function setUp() public { 25 | bemToken = new BemToken(); 26 | bemPresale = new BemPresale( 27 | 100000000000000000000000, 28 | 0.0009 ether, 29 | 0.01 ether, 30 | IERC20(bemToken), 31 | adMerkleRoot 32 | ); 33 | bemVesting = new PresaleTokenVesting(IERC20(bemToken), merkleRoot); 34 | bemToken.initialMint(1000000000000000000000000000); 35 | vm.prank(address(bemToken)); 36 | bemToken.approve(address(this), 100000000000000000000000); 37 | bemToken.externalTransfer( 38 | address(bemVesting), 39 | 100000000000000000000000 40 | ); 41 | } 42 | 43 | function testSetVesting() public { 44 | vm.startPrank(user1); 45 | vm.deal(user1, 0.1 ether); 46 | console.log(user1); 47 | console.log(user2); 48 | bemPresale.contributeToPresale{value: 0.009 ether}(); 49 | vm.stopPrank(); 50 | vm.startPrank(user2); 51 | vm.deal(user2, 0.1 ether); 52 | bemPresale.contributeToPresale{value: 0.008 ether}(); 53 | vm.stopPrank(); 54 | console.log( 55 | "Token allocated:", 56 | bemPresale.addressToPresaleAmount(user1) 57 | ); 58 | console.log( 59 | "Token allocated:", 60 | bemPresale.addressToPresaleAmount(user2) 61 | ); 62 | bytes32[] memory merkleProof = new bytes32[](1); 63 | merkleProof[ 64 | 0 65 | ] = 0xbad12c8c8d6226f8b2324bc24953621a73dfe253c242977347ec916119b0408c; //Use Openzeppelin's js library for MerkleRoot and MerkleProof generation... 66 | bemVesting.setVesting(user1, 2996899658660000000000, merkleProof); 67 | bytes32 vestingScheduleId = bemVesting 68 | .computeVestingScheduleIdForHolder(user1); 69 | assertEq( 70 | bemVesting.getVestingInfo(vestingScheduleId).beneficiary, 71 | user1 72 | ); 73 | // console.log(bemVesting.getVestingInfo(vestingScheduleId).beneficiary); 74 | // console.log(bemVesting.getVestingInfo(vestingScheduleId).totalAmount); 75 | // console.logBytes32(vestingScheduleId); 76 | } 77 | 78 | function testVestingRelease() public { 79 | testSetVesting(); 80 | bytes32 vestingScheduleId = 0x344fe5fd3c8a7c63c8c87eb3fc6b39c1a96ced3e956d3a9c234f0133d3fe6c80; 81 | vm.warp(block.timestamp + (185 * 1 days)); 82 | // console.log(address(this)); 83 | vm.startPrank(user1); 84 | // console.log(user1); 85 | // console.log(msg.sender); 86 | //749.224914665 87 | //749.224914665 88 | bemVesting.release(vestingScheduleId); 89 | console.log("firstUnlock:", IERC20(bemToken).balanceOf(user1)); 90 | uint256 firstUnlockAmount = 749224914665000000000; 91 | console.logBool(IERC20(bemToken).balanceOf(user1) == firstUnlockAmount); 92 | // assertEq(uint(IERC20(bemToken).balanceOf(user1)), firstUnlockAmount); 93 | vm.stopPrank(); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /test/BremPresaleTest.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "forge-std/Test.sol"; 5 | import "../src/BemPresale.sol"; // Adjust the path according to your project structure 6 | import "../src/Bem.sol"; 7 | import "forge-std/console.sol"; 8 | import "@chainlink/src/interfaces/feeds/AggregatorV3Interface.sol"; 9 | import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; 10 | 11 | contract BemPresaleTest is Test { 12 | AggregatorV3Interface priceFeed; 13 | BemPresale bemPresale; 14 | BemToken bemToken; 15 | IERC20 token; // Mock token interface 16 | address deployer; 17 | address user1 = makeAddr("user1"); 18 | address user2 = makeAddr("user2"); 19 | address user3 = makeAddr("user3"); 20 | bytes32 merkleRoot = 21 | 0x3a66ce04bfa0fac12c5b24f150c3b7b16f81a7ddae4778862490612445a7c5ae; // Example merkle root, adjust as needed 22 | 23 | uint256 public constant tokenPriceUsd = 0.0075 * 1e18; //$0.0075 24 | 25 | //Events 26 | event PresaleContribution( 27 | address indexed contributor, 28 | uint256 amount, 29 | uint256 tokensAllocated 30 | ); 31 | event TokensWithdrawn(address _receiver, uint256 _amount); 32 | event AirDrop(address source, address destination, uint256 _amount); 33 | 34 | function setUp() public { 35 | deployer = address(this); 36 | // Deploy your token contract and BemPresale contract here 37 | // Assuming you have a mock token contract or you can deploy a real one for testing 38 | // token = new MockToken(); 39 | // console.log("TestContractAddress:", address(this)); 40 | bemToken = new BemToken(); 41 | bemToken.initialMint(1000000000000000000000000000); 42 | token = IERC20(bemToken); 43 | bemPresale = new BemPresale( 44 | 10 ether, // presaleCap 45 | 0.0009 ether, // presaleMinPurchase 46 | 0.11 ether, // presaleMaxPurchase 47 | IERC20(0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f), // tokenAddress 48 | merkleRoot 49 | ); 50 | console.log("user1:", user1); 51 | console.log("user2:", user2); 52 | vm.startPrank(address(bemToken)); 53 | bemToken.approve(address(this), 1000000000000000000000000); 54 | vm.stopPrank(); 55 | bemToken.externalTransfer( 56 | address(bemPresale), 57 | 1000000000000000000000000 58 | ); 59 | bemPresale.restartPresale(); 60 | // Additional setup like funding the contract with tokens for airdrop, etc. 61 | } 62 | 63 | function testContributeToPresale() public { 64 | // Activate presale 65 | // vm.prank(deployer); 66 | // bemPresale.restartPresale(); 67 | 68 | int256 ethUSD = chainlinkPriceFeed(); 69 | // uint256 usdValueForEthDeposit = ABDKMath64x64.mulu( //Using ABDKMath64x64 for high precision on calculation 70 | // ABDKMath64x64.divu(1000000000000000, 1e10), 71 | // uint256(ethUSD) 72 | // ); 73 | // uint128 tokenAllocated = uint128( 74 | // ABDKMath64x64.divu((usdValueForEthDeposit * 1e18), tokenPriceUsd) 75 | // ); 76 | uint256 ethDeposited = 0.001 ether; 77 | uint256 usdValueForEthDeposit = (ethDeposited * uint256(ethUSD)) / 1e18; 78 | 79 | uint256 tokenAllocated = (usdValueForEthDeposit * 1e18) / tokenPriceUsd; 80 | 81 | // Simulate sending ETH to the presale 82 | vm.startPrank(user1); 83 | vm.deal(user1, 1 ether); 84 | vm.expectEmit(true, true, true, true); 85 | emit PresaleContribution(user1, 0.001 ether, tokenAllocated); 86 | bemPresale.contributeToPresale{value: 0.001 ether}(); 87 | 88 | // Check user's presale amount and raised amount 89 | assertEq(bemPresale.addressToPresaleAmount(user1), tokenAllocated); 90 | assertEq(bemPresale.presaleRaisedAmount(), 0.001 ether); 91 | vm.stopPrank(); 92 | } 93 | 94 | function chainlinkPriceFeed() internal returns (int256) { 95 | priceFeed = AggregatorV3Interface( 96 | 0x694AA1769357215DE4FAC081bf1f309aDC325306 97 | ); 98 | (, int256 price, , , ) = priceFeed.latestRoundData(); 99 | return price; 100 | } 101 | 102 | function testPauseAndRestartPresale() public { 103 | vm.prank(deployer); 104 | bemPresale.pausePresale(); 105 | assertFalse(bemPresale.isPresaleActive()); 106 | 107 | vm.prank(deployer); 108 | bemPresale.restartPresale(); 109 | assertTrue(bemPresale.isPresaleActive()); 110 | } 111 | 112 | function testWithdrawTokens() public { 113 | // Assuming setup includes minting tokens to the BemPresale contract 114 | uint256 amount = 1000; 115 | vm.expectEmit(true, true, true, true); 116 | emit TokensWithdrawn(user1, amount); 117 | console.log( 118 | "TokenBalance:", 119 | IERC20(bemToken).balanceOf(address(bemPresale)) 120 | ); 121 | vm.prank(deployer); 122 | bemPresale.withdrawTokens(user1, amount); 123 | 124 | // Check token balance of user1 125 | assertEq(IERC20(bemToken).balanceOf(user1), amount); 126 | } 127 | 128 | function testClaimAirdrop() public { 129 | bytes32[] memory merkleProof = new bytes32[](1); 130 | merkleProof[ 131 | 0 132 | ] = 0x1259f3ff2f491efceef2086c124e6552f460a90747628bcd93a89753caaa9bc1; //Use Openzeppelin's MerkleTree js library for generation of proofs and root 133 | uint256 tokenAmount = 1000000000000000000000; 134 | address airdropClaimee = 0x29E3b139f4393aDda86303fcdAa35F60Bb7092bF; 135 | console.log(merrkleProof()); 136 | 137 | vm.expectEmit(true, true, true, true); 138 | emit AirDrop(address(bemPresale), user1, tokenAmount); 139 | 140 | vm.prank(deployer); 141 | // bemToken.approve(); 142 | bemPresale.claimAirdrop(merkleProof, airdropClaimee, tokenAmount); 143 | 144 | assertEq(token.balanceOf(airdropClaimee), tokenAmount); 145 | } 146 | 147 | function merrkleProof() public view returns (bool) { 148 | bytes32[] memory merkleProof = new bytes32[](1); 149 | 150 | merkleProof[ 151 | 0 152 | ] = 0x1259f3ff2f491efceef2086c124e6552f460a90747628bcd93a89753caaa9bc1; 153 | uint256 tokenAmount = 1000000000000000000000; 154 | address airdropClaimee = 0x29E3b139f4393aDda86303fcdAa35F60Bb7092bF; 155 | bytes32 leaf = keccak256( 156 | bytes.concat(keccak256(abi.encode(airdropClaimee, tokenAmount))) 157 | ); 158 | bool proof = MerkleProof.verify(merkleProof, merkleRoot, leaf); 159 | return proof; 160 | } 161 | } 162 | --------------------------------------------------------------------------------