We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

Because the contract would not allow the holder to update their token URI. The 0xcert Framework (one implementation of ERC-721) separates permissions for creating NFTs and changing their URIs.


1

Sure, smart contract may receive, hold, and send ERC-20 tokens. There are many smart contracts out there that do this. The usual patter for a smart contract receiving tokens from user looks like this: User allows smart contract to take his tokens by calling approve on token smart contract. User calls smart contract and tells it to take user's tokens,...


0

Sure, it is very common for smart contracts to call each other's functions and do something with returned results. To do this, you need the following: The calling contract should know API of the callee. The calling contract should know that address of the callee. The calling contract should be called itself by somebody to have a chance to do something (...


0

Take a look at this example: pragma solidity ^0.5.8; contract YourContract { //InterestRateModel instance InterestRateModel interest_rate_model; constructor(address _interest_rate_model_contract_address) public { interest_rate_model = InterestRateModel(_interest_rate_model_contract_address); } function ...


0

For a simple token, depending on your requirements, you may not need it to be pausable or even potentially even mintable. Based on the SimpleToken example you could have something like the following where the total supply of tokens is minted to the deployer of the contract, with no functionality to mint additional tokens. As always, you should do ...


0

I doubt any exchange accepts private blockchain's coins and/or tokens. In the end it's of course up to the exhchange, but there are at least the following problems: 1) As you control the blockchain you can just take it down when you want to. What should happen to people who have bought your coin/token outside the blockchain? 2) You are able to manipulate ...


1

As you are using OpenZeppelin contracts you should be quite safe from various exploits - unless you have such in your own code which utilizes OpenZeppelin. OpenZeppelin is well known, widely used and battle-tested. As for your questions: 1) The code is secure as you are just using OpenZeppelin's functionality and not doing anything strange/fancy yourself. ...


0

Found the answer to my question: The data field from the returned Log struct contains indeed the transferred token amount value: The Bytes' vector needs to be converted into a hexadecimal figure (by looping through the vector and converting its value at each index into a hex and concatenating all the converted values together) to look like the log's data ...


0

At first interface of eip1155 has no alike you offer method. And we need to use some interface or contract instance to create new, but by this protocol must to be possible add any contract. (univeral interface not exist) how to generate an address for a new token? Let see, all contract get the address when they was issued. And if you do it via another ...


0

I need to create an API function like function createToken() returns (address). You should return a uint256 (not an address) because tokens in ERC1155 are represented by ids: these tokens are not contracts that have an address. Should I just use an incrementing-by-one value starting from 1? Yes, that's what the reference implementation of ERC1155 does. ...


2

The ERC20 specification states that they should be public instead of external. It does violate the ERC20 specification if you mark them as external. However, in practice this should not be an issue. The difference between external and public functions are that in public functions, the call data is copied to memory first. In external functions, the data is ...


Top 50 recent answers are included