Skip to content

Instantly share code, notes, and snippets.

@devonwesley
Last active November 29, 2017 18:31
Show Gist options
  • Save devonwesley/a25c0d721120b9f1c40caebec43609a3 to your computer and use it in GitHub Desktop.
Save devonwesley/a25c0d721120b9f1c40caebec43609a3 to your computer and use it in GitHub Desktop.
function renderContractList() {
const contractListContainer = document.getElementById('contract-list')
const { contracts } = compiledContract
Object.keys(contracts).forEach((contract, index) => {
const label = `contract-id-${contract}-${Math.random()}`
const gas = contracts[contract].gasEstimates.creation
createContractInfo(gas, contract, label, function (el) {
contractListContainer.appendChild(el)
const btnContainer = document.getElementById(label)
btnContainer.appendChild(
buttonFactory('primary', contract, contracts[contract], 'details')
)
btnContainer.appendChild(
buttonFactory('danger', contract, contracts[contract], 'deploy')
)
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment