Questions tagged [interfaces]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
6 views

Possible Security Issues On Web Layer Payment Request and Confirmation

This is more likely a design consultation rather than an issue. I want to introduce additional standards in ISO20022 to promote crypto payment through common payment interface to eliminate 3rd party ...
0
votes
0answers
12 views

Uniswap Fork: Able to add liquidity, but not able to swap

I am forking uniswap and deploying it on Rinkbey TestNet. I have successfully deployed factory, router, weth contracts. I have replaced the respective addresses in the uniswap interface code. I ...
0
votes
1answer
11 views

Loop contract addresses with dynamic Interface Name

I have multiple contract's addresses and their respective interfaces. Name of contracts are: 1. ContractA_v1 2. ContractA_v2 Name of interfaces are: 1. IContractA_v1 2. IContractA_v2 ...
0
votes
1answer
40 views

Fork uniswap including interfcae

I am trying to fork uniswap. I have successfully deployed uniswap-core and uniswap-periphery on my local machine (ganache).For this, I could get many tutorials and articles. But could not find a ...
0
votes
1answer
12 views

Putting interfaces in one interface

A noob question: is it possible or a good practice to put interfaces into one master interface such that all contracts in a DApp only import one interface?
0
votes
1answer
24 views

Solidity: Interfaces in contracts

Recently, I have stumbled upon multiple examples of Solidity contracts that make use of Interfaces, yet seem to define an interface for one and one contract only. Said Interface is then defined in the ...
1
vote
0answers
11 views

Implement interface function as mapping property

Why can we implement an interface function as mapping property? There's something on doc that explains this behaviour? I couldn't find anything related, but I'm assuming that a mapping property ...
0
votes
0answers
12 views

Enum in interface

Is it possible by creating any function in the interface user can declare his own set of enum states? Let's say for example:- I want to create an interface using which the user can declare his own set ...
0
votes
1answer
10 views

Can we have a instance of a interface?

I came across this code, I wanted to know what exactly IERC20(token address) is signifying here whether it is the instance of token or just the reference to the contract of token to which the user is ...
0
votes
1answer
133 views

How to properly use IERC20 interface in a contract using solidity 0.8.0 [duplicate]

Dear Ethereum/Solidity developers, I have a small solidity contract which should allow the contract to spend the owner's ERC20 tokens. I currently have the following interface defined interface IERC20 ...
0
votes
1answer
7 views

Do I have to include every method in an interface?

I'm using a 3rd party contract in one of my contracts. I've created an interface for the 3rd party, do I have to include every external method in the interface, or just the ones that I need to use in ...
1
vote
1answer
31 views

Convert ABI to HTML interface (input)

Is there a way to get code that convert ABI to HTML interface ? I found example in multiples apps but can't find the code, lot of dead github. Apps where I find what I want : https://abi.hashex.org/ ...
0
votes
0answers
12 views

MyEtherWallet interact with contract : generate input from ABI

Do you know some code to generate a contract interaction from ABI like there is on MyEtherWallet ?
1
vote
0answers
52 views

ERC-2222 : Funds Distribution Token implementation for a fee contract

My MainCore contract is a contract who sell NFT, and all the sell and buy have a 1% fee for team developper (uint DevelopperCutTotalSupply). I try to implement the ERC-2222 "Funds Distribution ...
0
votes
1answer
33 views

TxOriginVictim(msg.sender).transferTo(owner, msg.sender.balance): What is the purpose of Interface and what is TxOriginVictim(msg.sender)?

I have two contracts in the context of tx.origin Vulnerability: pragma solidity ^0.5.8; contract TxOriginVictim { address owner; constructor() public{ owner = msg.sender; } ...
0
votes
1answer
13 views

How this snippet is linking contracts? How each contract finds the other

I'm trying to understand how can two contracts be deployed and interact with each other, given that I don't have their addresses before deployment. I ended in this question and I don't understand the ...
1
vote
1answer
214 views

Why use the Interface (IERC20), instead of the implementation contract (ERC20)?

I'm playing with a contract that uses an ERC20 token, and I can see basically 2 options to init the token: Use the interface contract (IERC20) Use the implemented contract (ERC20) Interface version: ...
0
votes
1answer
66 views

Reflect Base contract's update in another contract

I have wanted to know what concept is it called when we want two contracts which are deployed on the Network, reflect the transaction and updates in another contract. for example: contract Base{ ...
1
vote
3answers
51 views

Do view functions cause reentrancy vulnerabulity?

It's well known that calling an external function before changing something in the contract causes a security problem called "reentrancy vulnerability". Does calling an external function ...
0
votes
0answers
19 views

How to use web3 when one smart contract is interfacing with another?

A few months back I posted this question on this form. Since then, I've used the interface method to make my smart contracts interact together. I didn't have any problem while testing and developing ...
0
votes
0answers
54 views

how to pass fix size array via interface in solidity 0.4.25

I used the following code interface test{ function testfunction(uint[20] memory P, uint[20] memory Q) external returns(uint,bool,uint); } It gives the error Location has to be calldata for external ...
1
vote
1answer
20 views

In interface does the function listed have to be exactly the same as they are in contract?

In solidity 0.7.x, I am creating an interface of contract A in contract B to allow contract B call functions in contract A. contract A { function transfer(address recipient, uint256 amount) public ...
0
votes
2answers
75 views

remote contract function call with solidity

I've deployed this very simple Contract: contract Contract1 { function myfunction(uint param1) public returns (uint) { return param1+1; } } Now, I've deployed a second contract: ...
0
votes
1answer
126 views

Is it possible to call a public array from another contract?

Let's say there is a uint[] public MyArray declared in contract_A. Is there a possiblility to create an interface contract_A that would allow to read the values in MyArray from another contract, or ...
2
votes
2answers
781 views

Can't override ERC20 Methods

I try to override ERC20 methods ... The doc says it should be possible but I get the error: CompileError: @openzeppelin/contracts/token/ERC20/ERC20.sol:96:5: TypeError: Trying to override non-virtual ...
0
votes
1answer
194 views

ERC20 Interface

When you make a token, must you have an ERC20 Interface (such as the one below)? What is the purpose of it? pragma solidity 0.6.6; /// @notice ERC20 https://eips.ethereum.org/EIPS/eip-20 with ...
0
votes
0answers
144 views

Wrapping functions in interfaces to enable higher order function capability in Solidity?

Let's say I want to have higher order function capabilities in my Solidity Dapp. Also I want to be able to pass in new functions as input to higher order functions contained within contracts that were ...
0
votes
1answer
173 views

Uncaught TypeError: TheContract.at is not a function

just trying my first steps in ethereum and web3. So i found this tutorial: https://www.youtube.com/watch?v=hcTPjpPvas8 But it raise an error: index.html:85 Uncaught TypeError: TheContract.at is not a ...
0
votes
1answer
825 views

How to call “payable function” via interface in solidity [duplicate]

I have a function marked as payable in contract A and I want to call it from contract B so that msg.value in contract A can have its desired value and contract A must have balance of sent amount , how ...
2
votes
1answer
445 views

How to properly define an interface in Solidity 0.6?

One of the breaking changes of solidity 0.5 was making explicit function visibility mandatory, hence all interface functions must be defined as external today. In solidity 0.6, there seems to be two ...
1
vote
1answer
49 views

How to deploy smart contract so that average user can interact with its public functions?

I sucesfully wrote and deployed smart contract using Remix and Metask to generate hashes used as keys. This contract has few payable public functions that set or get some numbers. After deploying ...
0
votes
1answer
55 views

Like an ERC20 interface, do we have any interface or a smart contract that supports creating and transferring Ether on Ethereum?

To create a token on Ethereum, we use ERC20 token interface to design our token smart contract that captures functions required like mint(), tranfer(), balanceOf(), etc. Similarly, do we have any ...
0
votes
1answer
250 views

Buy tokens form other smart contract using interface

I have two separate contracts, let's say Token and BuyFrom. pragma solidity >=0.4.22 <0.7.0; interface InterfaceToken { function invest(address contributor) external payable; } contract ...
0
votes
0answers
85 views

is there any possibility to read struct via interface from deployed contract?

the contract is deployed which has no view function for that particular struct, is there any way to read values via interface in another contract which I want to write and deploy ?
2
votes
1answer
201 views

What is the use of a interface or function without implementation?

Take, for example, this code. The interface contains function without implementation, so how it's useful. pragma solidity ^0.5.0; interface Calculator { function getResult() external view returns(...
0
votes
2answers
56 views

What does it mean to declare an item of type contract?

Wasn't quite sure how to word the title, but in the following code: contract KittyInterface { ... } contract ZombieFeeding is ZombieFactory { KittyInterface kittyContract; } what is the ...
0
votes
2answers
74 views

How bad is it to change a function inside ERC721 interface?

I'm creating a NFT and I want the transferFrom function to be payable. In order to do so I need to edit the ERC721 interface and make that function payable also there. If I do so everything compiles ...
1
vote
1answer
72 views

What does mutability guarantees mean in erc721

Some functions from ERC-721 interface contain payable modifiers. function transferFrom(address _from, address _to, uint256 _tokenId) external payable; I was wondering why it is payable and found ...
2
votes
0answers
39 views

Nested usage of interfaces?

Using solidity ^4.x, it seems I can use an interface as a parameter type in a function from a different interface. Example: interface IERC20 { function transfer() external; } import "./IERC20....
1
vote
2answers
6k views

File import callback not supported import “./IERC20.sol”;

when I try to compile my contract I see errors like this : DemirelToken.sol https://eksiup.com/p/4z49413damc3 here's the code : pragma solidity ^0.5.0; import "node_modules/openzeppelin-...
3
votes
1answer
806 views

ERC721: Interface ID Registration

Why we need to register Interface ID in ERC721 token. I was just going through the openzeppelin-solidity erc721 code and curious to know that why we need to use this. That interface id register code ...
3
votes
1answer
2k views

How to interact with ERC20 interface?

My target is to send from the ERC20Wrapper.sol deployed contract BAT tokens to my hard coded address. I've created ERC20 Interface: pragma solidity 0.4.18; interface ERC20 { function ...
0
votes
1answer
60 views

DAPP WALLET transaction always fails

To improve my skills in solidity I'm working on a "wallet dapp". Based on smart contracts only, users can send ERC20 to another wallet. It works like that: user gives the following parameters: ...
0
votes
1answer
609 views

Solidity, how to cast SmartContract type to address

I am currently a bit stuck with my contract, the issue is following: I define a smartcontract type which is used for another address (aka address is smartcontract that provides the specified interface)...
0
votes
3answers
259 views

REMIX:This contract does not implement all functions and thus cannot be created

What should I do? pragma solidity ^0.4.21; contract ScoreInterface { function hit() public; function score() public view returns (uint); } This contract does not implement all ...
0
votes
2answers
402 views

Solidity how to check if user is already used another contract?

I am trying to figure out how to set up a simple communication between contracts. For example, we have a contract Passport, in which the user writes his data. After that, through the Election ...
1
vote
1answer
23 views

In case we have an interface written in a seperate .sol file how do we migrate it successfully?

HI consider i have 3 smart contracts A,B,C. I have a separate file D.sol which is an interface used in all A,B and C. What would the migration script look like for this project?
2
votes
0answers
316 views

Can I extend the interface of a contract without redeploying it?

The case I'm dealing with is a contract which should serve as a Data Abstraction Layer. So ideally, it should provide only getter functions and setter functions. For example, my interface is: ...
0
votes
1answer
128 views

how to parse values returned by one contract into another?

I've two contracts deployed one is UserRegistration and another is Exam I've getUser(uint id) method to fetch data of particular user using users mapping, function getUser(uint _id) public constant ...
1
vote
1answer
239 views

Can abstract contracts in solidity have state variables?

I want to have one deployed contract with my data structure and all data and another separate contract with functions that calls the deployed contract. If i've understood things correctly, one should ...