Hi @eazycode ,
I am creating a blockchain based App and I think your plugin might be useful.
My question is:
I understand that in order to send a transaction on Ethereum main net, metamask with funds is required.
However I want my app users to carry out transactions without having to install metamask. The funds should be deducted from my wallet.
Is it possible for a workflow such that the funds are drawn from my wallet (the app developer) and not from the app user.
I hope my question is clear
Please confirm solution.
Thanks
You can post approval() on your own wallet, basically allowing a smart contract to use specified permissions or full owner permissions of your wallet.
Then write it into a smart contract with solidity and have the server side actions make write calls to smart contract to control sending.
The smart contract route will allow you to whitelist sending users, set max and min sends, and overall provide a strong safety net against abuse if the contract is written correctly.
The simplest way to do it would be through Web3 Manager plugin
It works with your wallet private key (you can store the key safely in the database, just make sure you have set the correct privacy rules to database)
As an example take a look at our Rinkeby Faucet page
you can withdraw a small amount of test ETH (on Rinkeby network), but you can do this for any other network and token.
This error usually happens when the wallet is not connected, make sure you connect it first and then run this action.
Now i am getting this error…
The plugin Web3 & Metamask / action Smart Contract - Write a Web3 & MetaMask threw the following error: Error: Invalid number of parameters for “mint”. Got 1 expected 2!
I have already deployed and verified my smart contract here is my contract address. 0x5fd65B8355533E3FA5aaE460E71E87c72333D457 i just need to know what the second parameter is. the first parameter i have is mint quantity’s number . any help would be greatly apreciated.
also getting this error. how frustrating is this
The plugin Web3 & Metamask / action Smart Contract - Write a Web3 & MetaMask threw the following error: Error: invalid address (argument=“address”, value=“1”, code=INVALID_ARGUMENT, version=address/5.0.1) (argument="_to", value=“1”, code=INVALID_ARGUMENT, version=abi/5.0.0-beta.153)
Hi, how should I pass arguments of a contract I want to deploy? Cause I can’t make that functionality work right now and I think the problem might be there. I’m compiling on remix with optimization with the latest version, then i copy and paste api and bytocde on the abi and data action fields, and the arguments I just do like arg1,arg,2,arg3 but is not working at all.
@we11
Hi, take a look on demo page here at the bottom of the page. The arguments should be wrapped with square brackets as an array.
[arg1,arg,2,arg3]
Here is a screenshot from etherescan of your contract mint function.
payableAmount → The payable amount is the price, it needs to be indicated in the plugin Transaction value field. Convert it to Wei firstly.
_to → This is the parameter 1, the wallet that will receive the token.
_mintAmount → The parameter 2, amount of tokens to mint
Deploy a Smart Contract
Hi @ezdev
Newbie questions…
1, I have installed the plugin, seems to have fantastic features.
I am trying out the demo to deploy a smart contract. I created a solidity file in Remix and got the contract ABI from Remix and pasted it in the box.
The box where I need to paste the “Contract data”- what is it? How to go about it?
I tried using the “bytecode”- but I am getting an error message.
When I tried the same in my app, work flow, there is a box to add “arguments”- what is it?
I am trying to deploy a contract in Ropsten test network.
- I need to add Hex data in the Metamask.
I am not sending any eth or tokens, Its a Zero transaction but I want to add some meta-data to metamask (in hex format), which will appear in the etherscan window- as Input data .
How to use the plugin to feed this data via workflow?
please see image below
- Since there is no token transferred, Is it better to store input data in the smart contract or can I add it as input data in the etherscan info?
Any help/ video links will be appreciated.
Thanks in advance.
HI… do you know why when using the deep link on an iPhone, it takes the user into the metamask browser and to the link as described… BUT on android it just launches metamask to the home screen. The url is not even present in the browser if you select the browser tab in metamask. You literally have to go retype the entire URL in the metamask browser. Works perfect on iPhone not on android.
@ryan8
This is a deep redirect on metamask side nothing to do with the plug-in.
Oh is this normal behavior? Or is this something that is wrong with MM? I guess i am asking has it alway been this issue with MM or is this something they will likely fix soon? @chris.williamson1996
@ryan8 Supposably metamask pushed an update 12 hrs ago so should be fixed on MM side, it’s been a problem for a long time
It has nothing to do with web3 injection as those deep links are just placeholders metamask uses that conditionally redirect
For example if you did
yourapp.com/redirect?link=redirection
and on the redirect page that loads on click it pulls the redirection url and conditionally says
If A is true (ex is mobile) Go to link param
If B is true (ex is no mobile) go to App Store
Same concept with if user has metamask installed rather than is mobile.
@ezdev has no control over deep links in this plugin.
Gotcha… hopefully MM fixed it. Thank you for your quick responses!!!
I have tried every combination of _to and _mintAmount for my parameters. i have tried with Double quote marks on either side ( “_to” .). I have spent hours entering diffrent variations of the lines from the mint section of our smart contract. i have copied and pasted that section here…
function mint(address _to, uint256 _mintAmount) public payable {
uint256 supply = totalSupply();
require(!paused);
require(_mintAmount > 0);
require(_mintAmount <= maxMintAmount);
require(supply + _mintAmount <= maxSupply);
i am not getting the invalid number of parameters for mint error anymore, now i am getting this error…
Write a Web3 & MetaMask threw the following error: Error: invalid address (argument=“address”, value="_to\n", code=INVALID_ARGUMENT, version=address/5.0.1) (argument="_to", value="_to\n", code=INVALID_ARGUMENT, version=abi/5.0.0-beta.153)
Can anybody shed some light on this for me? i have spent over 10 hours so far on this and i am about to throw my laptop out the window. HELP ME PLEASE!!
thanks in advance.
READ AND WRITE TO A SMART CONTRACT
Hi @ezdev , @chris.williamson1996
Thanks for your response. I appreciate your guidance.
I hope you had a chance to look at my earlier question. item 509 and 510
I have 2 more new questions as below, hope you can help
In work flow, I choose Write to a smart contract
I see only one “Action Name” and 8 parameters
However in my smart contract I have several “Action Names” and under an action name I have 16 parameters.
How can I add more " Action names"?
How to add more parameters under each action name?
I see one text: Additional parameter- but it is not clickable . what does it do?
How to add more parameters?
If i run the workflow with only 8 parameters instead of the 16 in the smartcontract, I get an error message that “got 8 expected 16”, please see screen shot below
Thanks in Advance.
Each action you put in a workflow can just be a different action name to add multiple.
For parameters, respectfully…what do you need 16 parameters for id suggest just tweaking your contract to use like 8 then have owner only calls to update those other 8…
I’ve actually not seen a call with that many params before you may want to optimize.
You are right @chris.williamson1996 a contract function with 16 parameters doesn’t seem to be optimised and most likely could be simplified and it will also consume less gas fee.
It is the description of the field bellow “Transaction Value” that is optional as-well.