For a number of reasons, Ethereum Remix is great for developing in Solidity. However, I need to integrate what I develop there into some other Web3 front end stuff. So after each time I deploy a smart contract in Remix I have to copy and paste the contracts address as well as the ABI into another IDE so it can interact with the Web3 frontend.
Is there some sort of way to do the step of copying the contract address and ABI from Remix into a text file on my local system? I couldn't find a Remix API. Was wondering if anyone has another idea.
Related
I deployed smart contract, not verified I need same deployed code. I have live smart contract but not its code and sol file
Remix is telling me "Currently you have no contract instances to interact with." But that's because Remix Won't Allow me to deploy my contract. Please Help I'm new to thisPicture of my remix smart contract
You have not compiled your smart contract. You need to first compile your smart contract only then you can deploy your smart contract.
as most of the BEP20-Tokens-Contracts are online available on GitHub or BSCScan you should be able to just copy the code and paste it into remix.ethereum.org and deploy it. I did that and the contract deployed successfully to the BSC but the token information are missing. What do I do wrong?
Here is the code I copied: https://bscscan.com/address/0x0cF011A946f23a03CeFF92A4632d5f9288c6C70D#code
and here is my contract deployed to the BSC: https://bscscan.com/address/0xf5be6f7f00a4870b46f3ab6d16f5095731da97d7
I have just changed the name of the token, but the token information are not showing up on BscScan nor do I see the token in my Wallet. Any help is appreciated!
Your contract's bytecode contains just the Address contract bytecode. Since it's the first contract in the list (sorted alphabetically), I assume you simply forgot to select the contract that you wanted to compile.
You need to select the NyanCatToken contract (which effectively imports the Address as well) when compiling in Remix.
We have a smart contract factory which deploys smart contract instances. These smart contract instances use SafeMath.
We want verify code for these instance on Etherscan. But, Etherscan requires SafeMath library address to verify contract code.
How can I get the SafeMath library address for each instance?
SafeMath functions are all internal. There is no external library to link to. Hence no need to specify a library for Etherscan verification.
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol
https://solidity.readthedocs.io/en/latest/contracts.html#libraries
... code of internal library functions and all functions called from therein will at compile time be pulled into the calling contract, and a regular JUMP call will be used instead of a DELEGATECALL.
You can also ask questions about using OpenZeppelin on the Community Forum: https://forum.openzeppelin.com
Disclosure: I am the Community Manager at OpenZeppelin
I am trying to write upgradable smart contract in ethereum. Can anyone give an example of upgradable smart contract in ethereum and accessing data.
To write an upgradable smart contract I suggest you do the following (works for me):
Create a storage contract on which you will store all your map and variables. Add a modifier to the functions changing state. This modifier should require that an address must be present in a specific map (let’s call it authorized) to change the state of map or variable. Place the owner’s address in that map.
Write a function to authorize external address on the storage contract
Deploy another contract containing the logic of your app.
Autorise the logic contract on the storage contract.
Upon upgrade of the logic, deny access to the storage contract from the logic contract, deploy your upgraded logic and link the new contract to the storage.
Tadaa you now have an upgradable set of smart contracts.
Smart Contract cannot be replaced, but you can create a smart contract proxy to be able to replace the calling of all new Smart Contract functions (previous smart contracts cannot be removed on the main network ethereum).
Complete explanation and examples can be seen Here
You can implement follow Proxy Pattern
Blog
https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357
Smart contract upgradability is a state of the art area. Currently, there are a few solutions, but each of them has its own pros and cons. Here are the solutions with examples:
https://consensys.github.io/smart-contract-best-practices/software_engineering/