- Clone the repo:
$ git clone [email protected]:Jusdev89/Remix-Mini-Starter.git- Inside of the
mini_remix_stater
$ open index.html| function createContract(contract, panel) { | |
| const propHandler = lists => props => { | |
| if(!filterProps(props[0])) { | |
| const container = categorizeContractProps({ | |
| key: props[0], | |
| value: props[1], | |
| ...lists | |
| }) | |
| container.append(createContractElement(props, container)) |
| function createPropsContainers(panel, callback) { | |
| document.getElementById('contractFunction').appendChild(panel) | |
| const propsList = createPanelContainer('props') | |
| const hashList = createPanelContainer('hashes') | |
| const functionList = createPanelContainer() | |
| const banner = '<H3><strong>Contract Functions: </strong></H3>' | |
| functionList.innerHTML = banner | |
| panel.append(propsList) | |
| panel.append(hashList) |
| function categorizeContractProps(params) { | |
| const hashNames = { | |
| 'hash': 'hash', | |
| 'blockHash': 'blockHash', | |
| 'input': 'input', | |
| 'from': 'from', | |
| } | |
| if (hashNames[params.key]) { | |
| return params.hashList |
| function filterProps(prop) { | |
| const excludes = { | |
| '_eth': '_eth', | |
| 'abi': 'abi', | |
| 'allEvents': 'allEvents', | |
| 'to': 'to', | |
| 'value': 'value', | |
| 'blockNumber': 'blockNumber', | |
| 'address': 'address', | |
| 'transactionHash': 'transactionHash', |
| function createContractElement(contractProp, container) { | |
| return typeof contractProp[1] === 'function' | |
| ? createContractFunction(contractProp, container) | |
| : createContractProp(contractProp, 'P') | |
| } | |
| function createContractFunction(contractFunc, container) { | |
| const name = contractFunc[0] | |
| const func = contractFunc[1] | |
| const btn = document.createElement('BUTTON') |
| function createContractHash(name, hash, tag, className) { | |
| const el = document.createElement(tag) | |
| const value = name === 'input' | |
| ? `<br/><textarea style="width: 100%;">${hash}</textarea>` | |
| : hash | |
| el.className = className | |
| el.innerHTML = `<br/><strong>${name}</strong>: ${value}` | |
| return el |
$ git clone [email protected]:Jusdev89/Remix-Mini-Starter.gitmini_remix_stater$ open index.htmlGanache Blockchain:$ npm install --global ganache-cliWeb3 instance:if (typeof web3 !== 'undefined') {| module.exports = { | |
| networks: { | |
| development: { | |
| host: "127.0.0.1", | |
| port: 8545, | |
| network_id: "*", | |
| } | |
| } | |
| } |
| pragma solidity ^0.4.6; | |
| contract WalletLibrary { | |
| address owner; | |
| function initWallet(address _owner) { | |
| owner = _owner; | |
| } | |
| function changeOwner(address _newOwner) external { |