Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Prepare blockchain token minting #1155

Merged
merged 176 commits into from
Sep 18, 2019

Conversation

mederic-p
Copy link
Contributor

Issue/Task Number: 1149
Closes #1149

Overview

This PR adds the required blockchain interaction calls for token minting.

Changes

Add the following call to EthBlockchain.Adapter

  • :mint_erc20
  • :lock_erc20
  • :is_erc20_locked

Usage

Create an unlocked token using swagger's token.deploy_erc20 call.

Then in an iex -S mix (replace the addresses with your own):

Mint the token:

EthBlockchain.Adapter.call({:mint_erc20, %{contract_address: "0x624f6081473204343f43b37a910b1f79ecc2be69", from: "0x811ae0a85d3f86824da3abe49a2407ea55a8b053", amount: 100}}, [])

Check if the token is locked (shouldn't be at this point):

EthBlockchain.Adapter.call({:is_erc20_locked, %{contract_address: "0x624f6081473204343f43b37a910b1f79ecc2be69"}}, [])

Lock the token (prevent further minting):

EthBlockchain.Adapter.call({:lock_erc20, %{contract_address: "0x624f6081473204343f43b37a910b1f79ecc2be69", from: "0x811ae0a85d3f86824da3abe49a2407ea55a8b053"}}, [])      

Check again if the token is locked (should be at this point):

EthBlockchain.Adapter.call({:is_erc20_locked, %{contract_address: "0x624f6081473204343f43b37a910b1f79ecc2be69"}}, [])

@mederic-p mederic-p added this to the v2.0 milestone Sep 11, 2019
@mederic-p mederic-p self-assigned this Sep 11, 2019
@mederic-p mederic-p added this to 4-Review in eWallet Sep 11, 2019
Copy link
Contributor

@unnawut unnawut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor comments

apps/eth_blockchain/lib/eth_blockchain/token.ex Outdated Show resolved Hide resolved
@mederic-p mederic-p changed the base branch from plasma-poc to eth-blockchain September 18, 2019 04:52
@mederic-p mederic-p merged commit e5040a4 into eth-blockchain Sep 18, 2019
eWallet automation moved this from 4-Review to 5-Done Sep 18, 2019
@mederic-p mederic-p deleted the 1149-prepare-blockchain-token-minting branch September 18, 2019 06:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
eWallet
  
5-Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants