Skip to content

Instantly share code, notes, and snippets.

🤘
?

Josh critesjosh

🤘
?
Block or report user

Report or block critesjosh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 3boxVerify.txt
3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!
✅ did:muport:Qma2o5oqaVY9hdyNKpdCfGCutgWiotrL9mN3aPWFjnZ8kN ✅
Create your profile today to start building social connection and trust online. https://3box.io/
@critesjosh
critesjosh / Optimized.sol
Created May 17, 2018
Optimizations to the Unoptimized.sol contract
View Optimized.sol
pragma solidity ^0.4.0;
contract Optimized {
bool oftenTrue = true;
bool oftenFalse = false;
uint loops = 0;
bytes32 constant statictext = "Hello world";
@critesjosh
critesjosh / Unoptimized.sol
Last active May 17, 2018
An unoptimized solidity contract
View Unoptimized.sol
pragma solidity ^0.4.0;
contract Unoptimized {
bool oftenTrue = true;
bool oftenFalse = false;
uint loops = 0;
string greeting;
@critesjosh
critesjosh / Greeter.sol
Created May 14, 2018
Two greeter contracts. One referencing a library, the other not.
View Greeter.sol
pragma solidity ^0.4.0;
contract GreeterA {
string greeting;
uint count;
address[] greeted;
function GreeterA(string _greeting) {
greeting = _greeting;
}
@critesjosh
critesjosh / SimpleStorage.sol
Last active May 12, 2018
A simple storage contract
View SimpleStorage.sol
// deployed to the Rinkeby network @ 0x4103e048515a5ebdf34b32ed7692254a16c6d184
pragma solidity ^0.4.0;
contract SimpleStorage {
uint256 storedData;
uint256 public timesSet;
address public lastCaller;
event Updated(uint newValue);
View EIP20Factory.sol
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.18;
contract EIP20Interface {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
View gist:2fbace8145e4417ecb99cb9913b92069
// This will not compile
pragma solidity ^0.4.0;
contract X {}
contract A is X {}
contract C is A, X {}
// This is ok
View Relay.sol
contract Relay {
address public currentVersion;
address public owner;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function Relay(address initAddr) {
@critesjosh
critesjosh / circuit_breaker.sol
Last active Jan 15, 2018
Add pausability to a smart contract
View circuit_breaker.sol
pragma solidity ^0.4.10;
contract Pausable {
bool public stopped = false;
address private owner;
modifier isAdmin() {
if(msg.sender != owner) {
revert();
@critesjosh
critesjosh / Relay.sol
Created Jan 15, 2018
A relay contract for upgradable contracts
View Relay.sol
contract Relay {
address public currentVersion;
address public owner;
modifier onlyOwner() {
if (msg.sender != owner) {
throw;
}
_
}
You can’t perform that action at this time.