Example #1
0
def deploy():
    print("deleting child chain pickle")
    shutil.rmtree(plasma_config["PICKLE_DIR"], ignore_errors=True)
    
    deployer = Deployer()
    deployer.compile_all()
    deployer.deploy_contract("RootChain")
    
    deployer = Deployer(CONTRACTS_DIR=CONTRACTS_DIR, OUTPUT_DIR=OUTPUT_DIR)
    deployer.compile_all()
    erc721_contract = deployer.deploy_contract("ERC721Token", args=("My ERC721 Token", "MET721"))
    erc20_contract = deployer.deploy_contract("EIP20", args=(100000000 * (10 ** 18), "FEX", 18, "FEX"))
    print("minting erc721 ...")
    erc721_contract.mint(plasma_config["COINBASE"], 1, transact={'from': plasma_config["COINBASE"]})
    erc721_contract.mint(plasma_config["COINBASE"], 888, transact={'from': plasma_config["COINBASE"]})
    print("erc721 initialized")
    erc20_contract_2 = deployer.deploy_contract("EIP20", args=(100000000 * (10 ** 18), "TEST", 18, "TEST"))
    deployer.w3.eth.sendTransaction({'from': plasma_config["COINBASE"], 'to': to_checksum_address('0xd03ce696c376882fab5e808aad2ffeae2789a712'), 'value': deployer.w3.toWei(50, 'ether')})
    # wallet seed: desert allow payment inmate ribbon still hero claim return wear retreat stuff
    print("test wallet eth sent")
Example #2
0
import os
import pytest
from ethereum.tools import tester, _solidity
from ethereum.abi import ContractTranslator
from ethereum import utils
from plasma.utils import utils as plasma_utils
from plasma.root_chain.deployer import Deployer
from testing_lang.testing_language import TestingLanguage

OWN_DIR = os.path.dirname(os.path.realpath(__file__))

# Compile contracts once before tests start
deployer = Deployer()
deployer.compile_all()


@pytest.fixture
def t():
    tester.chain = tester.Chain()
    return tester


def get_dirs(path):
    abs_contract_path = os.path.realpath(
        os.path.join(OWN_DIR, '..', 'plasma', 'root_chain', 'contracts'))
    sub_dirs = [x[0] for x in os.walk(abs_contract_path)]
    extra_args = ' '.join(
        ['{}={}'.format(d.split('/')[-1], d) for d in sub_dirs])
    path = '{}/{}'.format(abs_contract_path, path)
    return path, extra_args