Skip to content

Instantly share code, notes, and snippets.

@mattmcgiv
Last active September 2, 2017 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmcgiv/342426abd4365b1a7cedeb8bdafe0a47 to your computer and use it in GitHub Desktop.
Save mattmcgiv/342426abd4365b1a7cedeb8bdafe0a47 to your computer and use it in GitHub Desktop.
blockcypher_example_response.json
[
{
"name": "/tmp/geth-compile-solidity400040342:Owned",
"solidity": "pragma solidity ^0.4.8;\n\ncontract Owned {\n address public owner;\n\n function Owned() {\n owner = msg.sender;\n }\n\n modifier onlyOwner {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) onlyOwner {\n owner = newOwner;\n }\n}\n\ncontract TokenRecipient {\n function receiveApproval (address _from, uint256 _value, address _token, bytes _extraData);\n}\n\ncontract ScrypTestflight is Owned {\n /* Public variables of the token */\n string public standard = \"Test Scryp 0.1\";\n string public name;\n string public symbol;\n uint8 public decimals;\n uint256 public totalSupply;\n\n /* This creates an array with all balances */\n mapping (address =\u003e uint256) public balanceOf;\n mapping (address =\u003e mapping (address =\u003e uint256)) public allowance;\n\n /* This generates a public event on the blockchain that will notify clients */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /* This notifies clients about the amount burnt */\n event Burn(address indexed from, uint256 value);\n\n /* Initializes contract with initial supply tokens to the creator of the contract */\n function ScrypTestflight(\n uint256 initialSupply,\n string tokenName,\n uint8 decimalUnits,\n string tokenSymbol,\n address centralMinter\n ) {\n if (centralMinter != 0 ) {\n owner = centralMinter;\n }\n\n /* Give the creator all initial tokens */\n balanceOf[msg.sender] = initialSupply;\n \n /* Update total supply */\n totalSupply = initialSupply;\n \n /* Set the name for display purposes */\n name = tokenName;\n \n /* Set the symbol for display purposes */\n symbol = tokenSymbol;\n \n /* Amount of decimals for display purposes */\n decimals = decimalUnits;\n }\n\n /* This is a function allowing the owner to mint new tokens after contract deployment */\n function mintToken(address target, uint256 mintedAmount) onlyOwner {\n balanceOf[target] += mintedAmount;\n totalSupply += mintedAmount;\n Transfer(0, owner, mintedAmount);\n Transfer(owner, target, mintedAmount);\n }\n\n /* Send coins */\n function transfer(address _to, uint256 _value) {\n /* Prevent transfer to 0x0 address. Use burn() instead */\n require(_to != 0x0);\n \n /* Check if the sender has enough */\n require(balanceOf[msg.sender] \u003e= _value);\n \n /* Check for overflows */\n require((balanceOf[_to] + _value) \u003e= balanceOf[_to]);\n \n /* Subtract from the sender */\n balanceOf[msg.sender] -= _value;\n \n /* Add the same to the recipient */\n balanceOf[_to] += _value;\n \n /* Notify anyone listening that this transfer took place */\n Transfer(msg.sender, _to, _value);\n }\n\n /* Allow another contract to spend some tokens in your behalf */\n function approve(address _spender, uint256 _value) returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n return true;\n }\n\n /* Approve and then communicate the approved contract in a single tx */\n function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {\n TokenRecipient spender = TokenRecipient(_spender);\n if (approve(_spender, _value)) {\n spender.receiveApproval(msg.sender, _value, this, _extraData);\n return true;\n }\n }\n\n /* A contract attempts to get the coins */\n function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {\n /* Prevent transfer to 0x0 address. Use burn() instead */\n require(_to != 0x0);\n \n /* Check if the sender has enough */\n require(balanceOf[_from] \u003e= _value);\n \n /* Check for overflows */\n require((balanceOf[_to] + _value) \u003e= balanceOf[_to]);\n \n /* Check allowance */\n require(_value \u003c= allowance[_from][msg.sender]);\n \n /* Subtract from the sender */\n balanceOf[_from] -= _value;\n \n /* Add the same to the recipient */\n balanceOf[_to] += _value;\n allowance[_from][msg.sender] -= _value;\n Transfer(_from, _to, _value);\n return true;\n }\n\n function burn(uint256 _value) returns (bool success) {\n /* Check if the sender has enough */\n require(balanceOf[msg.sender] \u003e= _value);\n \n /* Subtract from the sender */\n balanceOf[msg.sender] -= _value;\n \n /* Updates totalSupply */\n totalSupply -= _value;\n Burn(msg.sender, _value);\n return true;\n }\n\n function burnFrom(address _from, uint256 _value) returns (bool success) {\n /* Check if the sender has enough */\n require(balanceOf[_from] \u003e= _value);\n \n /* Check allowance */\n require(_value \u003c= allowance[_from][msg.sender]);\n \n /* Subtract from the sender */\n balanceOf[_from] -= _value;\n \n /* Updates totalSupply */\n totalSupply -= _value;\n Burn(_from, _value);\n return true;\n }\n}",
"bin": "6060604052341561000c57fe5b5b60008054600160a060020a03191633600160a060020a03161790555b5b610154806100396000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416638da5cb5b8114610045578063f2fde38b1461007e575bfe5b341561004d57fe5b6100556100a9565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b341561008657fe5b6100a773ffffffffffffffffffffffffffffffffffffffff600435166100c5565b005b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6000543373ffffffffffffffffffffffffffffffffffffffff9081169116146100ee5760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff83161790555b5b505600a165627a7a72305820327dccf720d763953e58af57ba21954dff463fc53a1ce4301dc21ebb8669f9c20029",
"abi": [
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"type": "function"
},
{
"inputs": [],
"payable": false,
"type": "constructor"
}
],
"gas_limit": 500000,
"params": [
21000000,
"ScrypTestPreAlpha00",
2,
"$c",
"55b632d40328b69d6efdc47bbfa9d7e8928f826c"
]
},
{
"name": "/tmp/geth-compile-solidity400040342:ScrypTestflight",
"solidity": "pragma solidity ^0.4.8;\n\ncontract Owned {\n address public owner;\n\n function Owned() {\n owner = msg.sender;\n }\n\n modifier onlyOwner {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) onlyOwner {\n owner = newOwner;\n }\n}\n\ncontract TokenRecipient {\n function receiveApproval (address _from, uint256 _value, address _token, bytes _extraData);\n}\n\ncontract ScrypTestflight is Owned {\n /* Public variables of the token */\n string public standard = \"Test Scryp 0.1\";\n string public name;\n string public symbol;\n uint8 public decimals;\n uint256 public totalSupply;\n\n /* This creates an array with all balances */\n mapping (address =\u003e uint256) public balanceOf;\n mapping (address =\u003e mapping (address =\u003e uint256)) public allowance;\n\n /* This generates a public event on the blockchain that will notify clients */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /* This notifies clients about the amount burnt */\n event Burn(address indexed from, uint256 value);\n\n /* Initializes contract with initial supply tokens to the creator of the contract */\n function ScrypTestflight(\n uint256 initialSupply,\n string tokenName,\n uint8 decimalUnits,\n string tokenSymbol,\n address centralMinter\n ) {\n if (centralMinter != 0 ) {\n owner = centralMinter;\n }\n\n /* Give the creator all initial tokens */\n balanceOf[msg.sender] = initialSupply;\n \n /* Update total supply */\n totalSupply = initialSupply;\n \n /* Set the name for display purposes */\n name = tokenName;\n \n /* Set the symbol for display purposes */\n symbol = tokenSymbol;\n \n /* Amount of decimals for display purposes */\n decimals = decimalUnits;\n }\n\n /* This is a function allowing the owner to mint new tokens after contract deployment */\n function mintToken(address target, uint256 mintedAmount) onlyOwner {\n balanceOf[target] += mintedAmount;\n totalSupply += mintedAmount;\n Transfer(0, owner, mintedAmount);\n Transfer(owner, target, mintedAmount);\n }\n\n /* Send coins */\n function transfer(address _to, uint256 _value) {\n /* Prevent transfer to 0x0 address. Use burn() instead */\n require(_to != 0x0);\n \n /* Check if the sender has enough */\n require(balanceOf[msg.sender] \u003e= _value);\n \n /* Check for overflows */\n require((balanceOf[_to] + _value) \u003e= balanceOf[_to]);\n \n /* Subtract from the sender */\n balanceOf[msg.sender] -= _value;\n \n /* Add the same to the recipient */\n balanceOf[_to] += _value;\n \n /* Notify anyone listening that this transfer took place */\n Transfer(msg.sender, _to, _value);\n }\n\n /* Allow another contract to spend some tokens in your behalf */\n function approve(address _spender, uint256 _value) returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n return true;\n }\n\n /* Approve and then communicate the approved contract in a single tx */\n function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {\n TokenRecipient spender = TokenRecipient(_spender);\n if (approve(_spender, _value)) {\n spender.receiveApproval(msg.sender, _value, this, _extraData);\n return true;\n }\n }\n\n /* A contract attempts to get the coins */\n function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {\n /* Prevent transfer to 0x0 address. Use burn() instead */\n require(_to != 0x0);\n \n /* Check if the sender has enough */\n require(balanceOf[_from] \u003e= _value);\n \n /* Check for overflows */\n require((balanceOf[_to] + _value) \u003e= balanceOf[_to]);\n \n /* Check allowance */\n require(_value \u003c= allowance[_from][msg.sender]);\n \n /* Subtract from the sender */\n balanceOf[_from] -= _value;\n \n /* Add the same to the recipient */\n balanceOf[_to] += _value;\n allowance[_from][msg.sender] -= _value;\n Transfer(_from, _to, _value);\n return true;\n }\n\n function burn(uint256 _value) returns (bool success) {\n /* Check if the sender has enough */\n require(balanceOf[msg.sender] \u003e= _value);\n \n /* Subtract from the sender */\n balanceOf[msg.sender] -= _value;\n \n /* Updates totalSupply */\n totalSupply -= _value;\n Burn(msg.sender, _value);\n return true;\n }\n\n function burnFrom(address _from, uint256 _value) returns (bool success) {\n /* Check if the sender has enough */\n require(balanceOf[_from] \u003e= _value);\n \n /* Check allowance */\n require(_value \u003c= allowance[_from][msg.sender]);\n \n /* Subtract from the sender */\n balanceOf[_from] -= _value;\n \n /* Updates totalSupply */\n totalSupply -= _value;\n Burn(_from, _value);\n return true;\n }\n}",
"bin": "60a0604052600e60608190527f5465737420536372797020302e31000000000000000000000000000000000000608090815261003e916001919061012b565b50341561004757fe5b60405162000e9d38038062000e9d83398101604090815281516020830151918301516060840151608085015192949384019391929101905b5b60008054600160a060020a03191633600160a060020a03161790555b600160a060020a038116156100c75760008054600160a060020a031916600160a060020a0383161790555b600160a060020a0333166000908152600660209081526040909120869055600586905584516100fc916002919087019061012b565b50815161011090600390602085019061012b565b506004805460ff191660ff85161790555b50505050506101cb565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061016c57805160ff1916838001178555610199565b82800160010185558215610199579182015b8281111561019957825182559160200191906001019061017e565b5b506101a69291506101aa565b5090565b6101c891905b808211156101a657600081556001016101b0565b5090565b90565b610cc280620001db6000396000f300606060405236156100e35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100e5578063095ea7b31461017557806318160ddd146101a857806323b872dd146101ca578063313ce5671461020357806342966c68146102295780635a3b7e421461025057806370a08231146102e057806379c650681461030e57806379cc67901461032f5780638da5cb5b1461036257806395d89b411461038e578063a9059cbb1461041e578063cae9ca511461043f578063dd62ed3e146104b6578063f2fde38b146104ea575bfe5b34156100ed57fe5b6100f5610508565b60408051602080825283518183015283519192839290830191850190808383821561013b575b80518252602083111561013b57601f19909201916020918201910161011b565b505050905090810190601f1680156101675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017d57fe5b610194600160a060020a0360043516602435610593565b604080519115158252519081900360200190f35b34156101b057fe5b6101b86105c4565b60408051918252519081900360200190f35b34156101d257fe5b610194600160a060020a03600435811690602435166044356105ca565b604080519115158252519081900360200190f35b341561020b57fe5b6102136106df565b6040805160ff9092168252519081900360200190f35b341561023157fe5b6101946004356106e8565b604080519115158252519081900360200190f35b341561025857fe5b6100f5610775565b60408051602080825283518183015283519192839290830191850190808383821561013b575b80518252602083111561013b57601f19909201916020918201910161011b565b505050905090810190601f1680156101675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102e857fe5b6101b8600160a060020a0360043516610802565b60408051918252519081900360200190f35b341561031657fe5b61032d600160a060020a0360043516602435610814565b005b341561033757fe5b610194600160a060020a03600435166024356108b8565b604080519115158252519081900360200190f35b341561036a57fe5b61037261097a565b60408051600160a060020a039092168252519081900360200190f35b341561039657fe5b6100f5610989565b60408051602080825283518183015283519192839290830191850190808383821561013b575b80518252602083111561013b57601f19909201916020918201910161011b565b505050905090810190601f1680156101675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042657fe5b61032d600160a060020a0360043516602435610a17565b005b341561044757fe5b604080516020600460443581810135601f8101849004840285018401909552848452610194948235600160a060020a0316946024803595606494929391909201918190840183828082843750949650610ad695505050505050565b604080519115158252519081900360200190f35b34156104be57fe5b6101b8600160a060020a0360043581169060243516610c10565b60408051918252519081900360200190f35b34156104f257fe5b61032d600160a060020a0360043516610c2d565b005b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561058b5780601f106105605761010080835404028352916020019161058b565b820191906000526020600020905b81548152906001019060200180831161056e57829003601f168201915b505050505081565b600160a060020a03338116600090815260076020908152604080832093861683529290522081905560015b92915050565b60055481565b6000600160a060020a03831615156105e25760006000fd5b600160a060020a038416600090815260066020526040902054829010156106095760006000fd5b600160a060020a03831660009081526006602052604090205482810110156106315760006000fd5b600160a060020a03808516600090815260076020908152604080832033909416835292905220548211156106655760006000fd5b600160a060020a0380851660008181526006602090815260408083208054889003905587851680845281842080548901905584845260078352818420339096168452948252918290208054879003905581518681529151600080516020610c778339815191529281900390910190a35060015b9392505050565b60045460ff1681565b600160a060020a0333166000908152600660205260408120548290101561070f5760006000fd5b600160a060020a03331660008181526006602090815260409182902080548690039055600580548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a25060015b919050565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561058b5780601f106105605761010080835404028352916020019161058b565b820191906000526020600020905b81548152906001019060200180831161056e57829003601f168201915b505050505081565b60066020526000908152604090205481565b60005433600160a060020a039081169116146108305760006000fd5b600160a060020a0380831660009081526006602090815260408083208054860190556005805486019055825481518681529151941693600080516020610c77833981519152929181900390910190a3600054604080518381529051600160a060020a03808616931691600080516020610c77833981519152919081900360200190a35b5b5050565b600160a060020a038216600090815260066020526040812054829010156108df5760006000fd5b600160a060020a03808416600090815260076020908152604080832033909416835292905220548211156109135760006000fd5b600160a060020a03831660008181526006602090815260409182902080548690039055600580548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a25060015b92915050565b600054600160a060020a031681565b6003805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561058b5780601f106105605761010080835404028352916020019161058b565b820191906000526020600020905b81548152906001019060200180831161056e57829003601f168201915b505050505081565b600160a060020a0382161515610a2d5760006000fd5b600160a060020a03331660009081526006602052604090205481901015610a545760006000fd5b600160a060020a0382166000908152600660205260409020548181011015610a7c5760006000fd5b600160a060020a0333811660008181526006602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020610c77833981519152929081900390910190a35b5050565b600083610ae38185610593565b15610c075780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360008314610ba7575b805182526020831115610ba757601f199092019160209182019101610b87565b505050905090810190601f168015610bd35780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610bf157fe5b6102c65a03f11515610bff57fe5b505050600191505b5b509392505050565b600760209081526000928352604080842090915290825290205481565b60005433600160a060020a03908116911614610c495760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058206315270e986f6d92333d1a5683acb5638e9081329ad1596e358130da2b2851b20029",
"abi": [
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "decimals",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_value",
"type": "uint256"
}
],
"name": "burn",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "standard",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "target",
"type": "address"
},
{
"name": "mintedAmount",
"type": "uint256"
}
],
"name": "mintToken",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "burnFrom",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "symbol",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
},
{
"name": "_extraData",
"type": "bytes"
}
],
"name": "approveAndCall",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"type": "function"
},
{
"inputs": [
{
"name": "initialSupply",
"type": "uint256"
},
{
"name": "tokenName",
"type": "string"
},
{
"name": "decimalUnits",
"type": "uint8"
},
{
"name": "tokenSymbol",
"type": "string"
},
{
"name": "centralMinter",
"type": "address"
}
],
"payable": false,
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "from",
"type": "address"
},
{
"indexed": true,
"name": "to",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "from",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "Burn",
"type": "event"
}
],
"gas_limit": 500000,
"params": [
21000000,
"ScrypTestPreAlpha00",
2,
"$c",
"55b632d40328b69d6efdc47bbfa9d7e8928f826c"
]
},
{
"name": "/tmp/geth-compile-solidity400040342:TokenRecipient",
"solidity": "pragma solidity ^0.4.8;\n\ncontract Owned {\n address public owner;\n\n function Owned() {\n owner = msg.sender;\n }\n\n modifier onlyOwner {\n require(msg.sender == owner);\n _;\n }\n\n function transferOwnership(address newOwner) onlyOwner {\n owner = newOwner;\n }\n}\n\ncontract TokenRecipient {\n function receiveApproval (address _from, uint256 _value, address _token, bytes _extraData);\n}\n\ncontract ScrypTestflight is Owned {\n /* Public variables of the token */\n string public standard = \"Test Scryp 0.1\";\n string public name;\n string public symbol;\n uint8 public decimals;\n uint256 public totalSupply;\n\n /* This creates an array with all balances */\n mapping (address =\u003e uint256) public balanceOf;\n mapping (address =\u003e mapping (address =\u003e uint256)) public allowance;\n\n /* This generates a public event on the blockchain that will notify clients */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /* This notifies clients about the amount burnt */\n event Burn(address indexed from, uint256 value);\n\n /* Initializes contract with initial supply tokens to the creator of the contract */\n function ScrypTestflight(\n uint256 initialSupply,\n string tokenName,\n uint8 decimalUnits,\n string tokenSymbol,\n address centralMinter\n ) {\n if (centralMinter != 0 ) {\n owner = centralMinter;\n }\n\n /* Give the creator all initial tokens */\n balanceOf[msg.sender] = initialSupply;\n \n /* Update total supply */\n totalSupply = initialSupply;\n \n /* Set the name for display purposes */\n name = tokenName;\n \n /* Set the symbol for display purposes */\n symbol = tokenSymbol;\n \n /* Amount of decimals for display purposes */\n decimals = decimalUnits;\n }\n\n /* This is a function allowing the owner to mint new tokens after contract deployment */\n function mintToken(address target, uint256 mintedAmount) onlyOwner {\n balanceOf[target] += mintedAmount;\n totalSupply += mintedAmount;\n Transfer(0, owner, mintedAmount);\n Transfer(owner, target, mintedAmount);\n }\n\n /* Send coins */\n function transfer(address _to, uint256 _value) {\n /* Prevent transfer to 0x0 address. Use burn() instead */\n require(_to != 0x0);\n \n /* Check if the sender has enough */\n require(balanceOf[msg.sender] \u003e= _value);\n \n /* Check for overflows */\n require((balanceOf[_to] + _value) \u003e= balanceOf[_to]);\n \n /* Subtract from the sender */\n balanceOf[msg.sender] -= _value;\n \n /* Add the same to the recipient */\n balanceOf[_to] += _value;\n \n /* Notify anyone listening that this transfer took place */\n Transfer(msg.sender, _to, _value);\n }\n\n /* Allow another contract to spend some tokens in your behalf */\n function approve(address _spender, uint256 _value) returns (bool success) {\n allowance[msg.sender][_spender] = _value;\n return true;\n }\n\n /* Approve and then communicate the approved contract in a single tx */\n function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {\n TokenRecipient spender = TokenRecipient(_spender);\n if (approve(_spender, _value)) {\n spender.receiveApproval(msg.sender, _value, this, _extraData);\n return true;\n }\n }\n\n /* A contract attempts to get the coins */\n function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {\n /* Prevent transfer to 0x0 address. Use burn() instead */\n require(_to != 0x0);\n \n /* Check if the sender has enough */\n require(balanceOf[_from] \u003e= _value);\n \n /* Check for overflows */\n require((balanceOf[_to] + _value) \u003e= balanceOf[_to]);\n \n /* Check allowance */\n require(_value \u003c= allowance[_from][msg.sender]);\n \n /* Subtract from the sender */\n balanceOf[_from] -= _value;\n \n /* Add the same to the recipient */\n balanceOf[_to] += _value;\n allowance[_from][msg.sender] -= _value;\n Transfer(_from, _to, _value);\n return true;\n }\n\n function burn(uint256 _value) returns (bool success) {\n /* Check if the sender has enough */\n require(balanceOf[msg.sender] \u003e= _value);\n \n /* Subtract from the sender */\n balanceOf[msg.sender] -= _value;\n \n /* Updates totalSupply */\n totalSupply -= _value;\n Burn(msg.sender, _value);\n return true;\n }\n\n function burnFrom(address _from, uint256 _value) returns (bool success) {\n /* Check if the sender has enough */\n require(balanceOf[_from] \u003e= _value);\n \n /* Check allowance */\n require(_value \u003c= allowance[_from][msg.sender]);\n \n /* Subtract from the sender */\n balanceOf[_from] -= _value;\n \n /* Updates totalSupply */\n totalSupply -= _value;\n Burn(_from, _value);\n return true;\n }\n}",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
},
{
"name": "_token",
"type": "address"
},
{
"name": "_extraData",
"type": "bytes"
}
],
"name": "receiveApproval",
"outputs": [],
"payable": false,
"type": "function"
}
],
"gas_limit": 500000,
"params": [
21000000,
"ScrypTestPreAlpha00",
2,
"$c",
"55b632d40328b69d6efdc47bbfa9d7e8928f826c"
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment