This file contains 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 DB { | |
// 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2 //1 | |
// 0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db //2 | |
// 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB //3 |
This file contains 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; | |
/** | |
@title Counter Contract | |
@author Jesse Raymond | |
@notice This is a simple counter contract, where users can increment and decrement the value of the variable count(see below), once every 30 seconds. | |
@dev Key concepts in solidity i used: | |
- Modifier, | |
- Internal function, |
This file contains 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.7.0 <=0.8.15; | |
contract Test { | |
mapping(address => uint256) balances; | |
function deposit() public payable { |
This file contains 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 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 | |
//amount of ethers in the smart contract |
This file contains 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 Enum { | |
enum Status { | |
Done, | |
AlmostDone, | |
Failed | |
} |
This file contains 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 Staking { | |
mapping(address => uint256) balances; | |
uint256 public deadline = 0; | |
event Stake(address sender, uint256 amount); | |
function stake() public payable { | |
require(msg.value > 0, "Input value"); |
This file contains 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 Energy { | |
/// State Variable | |
uint constant totalSupply = 100000; | |
uint public circulatingSupply; | |
string constant name = "Energy"; | |
string constant symbol = "ENG"; |
This file contains 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.4; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
contract Bridge is ERC20{ | |
address owner; | |
modifier onlyOnwer(){ |
This file contains 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 TestDelegateCall{ | |
//this contract is to test delegatecall in solidity | |
//to do this, the storage layout in both contract must be same | |
//delegate call, calls another contract but the storage of the calling | |
//contract is set instead while using the called contracts logic | |
uint64 public num; |
This file contains 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: UNLICENSED | |
pragma solidity ^0.8.9; | |
import "./multisig.sol"; | |
contract MultiSigFactory { | |
//a factory contract that create multiple clones of multisig.sol | |
//a function that create a new multisig | |
//an array that holds contract addresses created | |
//a function that calls the approve function in multisig.sol |
OlderNewer