Skip to content

Instantly share code, notes, and snippets.

View vis-kid's full-sized avatar

ed wassermann vis-kid

  • Milky Way
View GitHub Profile
@vis-kid
vis-kid / contracts...8_Modifiers.sol
Created February 4, 2022 20:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity 0.8.11;
contract Modifiers {
address public owner;
constructor() {
owner = msg.sender;
}
@vis-kid
vis-kid / contracts...7_ViewPure.sol
Created February 4, 2022 20:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity 0.8.11;
contract ViewAndPure {
uint stateNumber = 1;
function addViewFunction(uint _number) external view returns(uint) {
return stateNumber + _number;
}
@vis-kid
vis-kid / contracts...6_GasPrice.sol
Created February 4, 2022 20:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity 0.8.11;
contract CheckGasPrice{
function gasPrice() external view returns (uint) {
return tx.gasprice;
}
uint public i = 0;
function forever() public {
@vis-kid
vis-kid / contracts...5_EtherCheck.sol
Created February 4, 2022 20:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity 0.8.11;
contract EtherCheck {
uint public oneEther = 1 ether;
uint public oneWei = 1 wei;
function testOneEther() external pure returns (bool) {
return 1 ether == 1e18 wei;
}
@vis-kid
vis-kid / contracts...5_EtherCheck.sol
Created February 4, 2022 20:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity 0.8.11;
contract EtherCheck {
uint public oneEther = 1 ether;
uint public oneWei = 1 wei;
function testOneEther() external pure returns (bool) {
return 1 ether == 1e18 wei;
}
@vis-kid
vis-kid / contracts...4_SaveText.sol
Created February 4, 2022 20:06
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
pragma solidity 0.8.11;
contract TextStorage {
string public text;
function setText(string memory _text) external {
text = _text;
}
function getText() external view returns (string memory) {
@vis-kid
vis-kid / contracts...1_Storage.sol
Created February 4, 2022 20:05
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.22be8592.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {