This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Collect funds in a payable `stake()` function and track individual `balances` with a mapping: | |
| // ( Make sure to add a `Stake(address,uint256)` event and emit) | |
| // After some `deadline` allow anyone to call an `execute()` function | |
| // If the `threshold` was not met, allow everyone to call a `withdraw()` function | |
| // Add a `withdraw()` function to let users withdraw their balance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier:MIT | |
| pragma solidity ^0.8.0; | |
| contract increamentDecreament { | |
| // counter | |
| uint count = 1; | |
| uint256 deadline = block.timestamp + 30 seconds; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.0; | |
| contract simpleDepositContract { | |
| // emit an event when an end users deposits | |
| event depositEvent(address user, uint amount); | |
| // track individual balances |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.4; | |
| contract Vault{ | |
| // a contract where the owner create grant for a beneficiary; | |
| //allows beneficiary to withdraw only when time elapse | |
| //allows owner to withdraw before time elapse | |
| //get information of a beneficiary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity ^0.8.0; | |
| contract Vault { | |
| // a contract where the owner creat grant for a beneficiary; | |
| // allow beneficiary to withdrawl only when time elapse | |
| // allow owner to withdrawl before elapse time | |
| // get information of a beneficiary | |
| // amount of ethers in the smart contract |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity 0.8.4; | |
| contract Energy{ | |
| //have total supply | |
| //transferrable | |
| //name | |
| //symbol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Wallet Connect</title> | |
| <script src="https://cdn.jsdelivr.net/npm/@walletconnect/web3-provider@1.7.1/dist/umd/index.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| // An example of a consumer contract that relies on a subscription for funding. | |
| pragma solidity ^0.8.7; | |
| import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol'; | |
| import '@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol'; | |
| import '@chainlink/contracts/src/v0.8/ConfirmedOwner.sol'; | |
| /** | |
| * Request testnet LINK and ETH here: https://faucets.chain.link/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract DataStore{ | |
| uint256[50] _____gap_____; | |
| struct Data{ | |
| uint256[] numbers; | |
| bool in__; | |
| bytes32 key; | |
| } | |
| constructor() public{ | |
| returnDataSlot().key=keccak256('YEP FOUND IT'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contract Golfer { | |
| struct Data{ | |
| //always a preset date | |
| uint256 timeStart; | |
| //30 days after the start | |
| uint256 timeFinish; | |
| //names are at most 3 characters long | |
| string name; |
OlderNewer