Questions tagged [interfaces]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
486 views

How do I check in solidity if interface is supported?

In the new ERC721 documents (erc721.org), the interface says that one of the functions should be: /** * @dev Returns `true` if the contract implements `interfaceID` and`interfaceID` ...
2
votes
2answers
316 views

Interface initiailization

I'm following cryptozombies solidity tutorial. In lesson 2, chapter 11 it explains how to create an interface for CryptoKitties as follows: contract KittyInterface { function getKitty(uint256 _id) ...
1
vote
1answer
481 views

How does the ERC20 tutorial instantiate an unimplemented interface?

I've been going through the official Ethereum token tutorial and I noticed that the provided token code includes the following lines within the approveAndCall function: tokenRecipient spender = ...
0
votes
1answer
849 views

how to call one contract function into another contract

contract xyz { mapping(address => bool) Users; function add(address userAddress) { require(userAddress != 0x0 && !Users[userAddress]); Users[...
0
votes
1answer
93 views

Specify full ABI of another contract?

Contract A calls contract B. Does contract A need to know B's full ABI for its external functions? Or can you just give it the interface for the functions that contract A will call.
0
votes
1answer
712 views

Very simply: setProvider is not a function

I have a very simple contract already deployed to the kovan network I want to create a very simple web3 interface, so I'm following the truffle webpack metacoin example with the following app.js ...
4
votes
1answer
1k views

(Sub) contract vs. library vs. struct vs. Interface

First I googled and read through these questions: Creating multiple contracts or Single contract with struct Child contract vs struct Why are so many examples using separated contracts (e.g. crowed ...
1
vote
1answer
525 views

Array of interfaces of contracts

In an oop language, I could do the following: I can define an interface Foo with a function F(). I then define two classes Bar1 and Bar2 implementing this interface. I can then create an array of Foo ...
5
votes
1answer
5k views

Deploying abstract contracts and interfaces

I am trying to create a basic inheritance hierarchy with abstract/virtual formalisms. Consider the following two contracts: Abstract Contract (IUser.sol): contract IUser { function addUser (...
3
votes
1answer
243 views

Best practices for interacting with other contracts

I would like to know what is the best approach and the best practices to intercat with other contracts. Here are the MyFriendToken.sol and the MyService.sol: MyFriendToken.sol I would like to know ...
1
vote
0answers
51 views

What's so special about the .call() function?

All that the docs have to say about it is that it "lets the Ethereum network know we're not intending to persist any changes." So I get that it's used when not conducting a transaction. So, I decided ...
1
vote
0answers
249 views

ipcapi parameter usage

I initialize a node on my private test net passing only the eth interface in the ipcapi parameter expecting that I won't have access in the other interfaces such as admin etc.. However, when I attach ...
1
vote
1answer
282 views

Does an API standard for price feeds exist?

The ERC 20 defines a standard interface for designing a token contract. Does a similar standard exist for defining feeds that can be called by other contracts?
3
votes
1answer
955 views

Does a Solidity Interface Contract need to implement all functions, or only the function subset used in the contract that implements the interface?

Let's assume the following: There is a master contract A, an interface contract IB, and a slave contract B A implements IB to allow upgrading B without redeploying A Question: Does IB need to have ...
6
votes
3answers
8k views

How to call smart contract from html/Javascript

I want to have an html/Javascript code interact with a smart contract. Can someone please outline the basic/high level steps? I am seeing too many things spread across the net, finally confusing.
5
votes
1answer
3k views

How to get address of contract interface

In the contract below, how to look up address of tokenContract ? Operator != not compatible with types address and contract Token if(msg.sender != tokenContract) throw; contract ...

1
2