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
pragma solidity ^0.4.6; | |
contract Wallet { | |
address public owner; | |
address public _walletLibrary; | |
function Wallet(address libAddress, address _owner) public { | |
_walletLibrary = libAddress; | |
_walletLibrary.delegatecall(bytes4(keccak256("initWallet(address)")), _owner); | |
} |
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
const WalletLibrary = artifacts.require("./WalletLibrary.sol"); | |
const Wallet = artifacts.require("./Wallet.sol"); | |
module.exports = function(deployer, network, accounts) { | |
deployer | |
.deploy(WalletLibrary) | |
.then(() => | |
deployer.deploy(Wallet, WalletLibrary.address, accounts[0]) | |
); | |
}; |
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
pragma solidity ^0.4.6; | |
contract WalletLibrary { | |
address public owner; | |
modifier onlyOwner() { | |
require(msg.sender == owner); | |
_; | |
} |
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
pragma solidity ^0.4.18; | |
contract BasicToken { | |
mapping(address => uint256) balances; | |
string public constant NAME = "BasicToken"; | |
string public constant SYMBOL = "BTN"; | |
uint256 totalSupply_; | |
event Transfer(address indexed from, address indexed to, uint256 value); | |
function BasicToken (uint256 INITIAL_SUPPLY, address _owner) { |
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
var BasicToken = artifacts.require("./BasicToken.sol"); | |
module.exports = function(deployer, network, accounts) { | |
deployer.deploy(BasicToken, 10000000000, accounts[0]); | |
}; |
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
var VictimContract = eth.contract([ | |
{ | |
"constant": false, | |
"inputs": [], | |
"name": "withdraw", | |
"outputs": [], | |
"payable": false, | |
"stateMutability": "nonpayable", | |
"type": "function" | |
}, |
OlderNewer