Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [abstract]

The tag has no usage guidance.

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

In what ways can abstract contracts or interfaces be used? [duplicate]

I'm currently learning solidity with an udemy course: https://www.udemy.com/course/blockchain-developer/ and the contents of it are also published here: https://ethereum-blockchain-developer.com/000-...
TheDude's user avatar
  • 111
1 vote
0 answers
24 views

Why is adding a constructor to call an external contract causing a cascading effect on the children requiring them to be marked abstract?

I'm having issues with compiling this contract, this contract sits in a series of inherited contracts. Its #6 of 8 contracts that make up the whole NFT contract. Before adding the constructor I was ...
Benjamin Delgado's user avatar
0 votes
1 answer
44 views

Using methods from github

Is it possible too return value in this way? This is for an understanding of the mechanism of using a method from github Thank you! // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import &...
newbeee's user avatar
  • 21
0 votes
1 answer
14 views

Function override error and abstract error after importing the contract

*this a contract for erc721: contract erc721{ event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); event Approval(address indexed _owner,address indexed _approved, ...
Baby's user avatar
  • 29
0 votes
1 answer
406 views

Balancer swap abstract contract

I have a simple Balancer swap contract: pragma solidity ^0.8.0; import "@balancer-labs/v2-vault/contracts/interfaces/IVault.sol"; import "@balancer-labs/v2-vault/contracts/interfaces/...
Viktor Cortez's user avatar
1 vote
2 answers
1k views

How to override ERC20 _beforeTokenTransfer and _afterTokenTransfer functions if there is no need of this in my contract

I am trying to use openzepplin's ERC20 token and because of this two functions _beforeTokenTrandfer and _afterTokenTransfer I has to use abstract in my smart contract and because of abstract its not ...
Aman's user avatar
  • 23
0 votes
1 answer
144 views

How ERC721URIStorage is abstract even though all the functions are implemented?

This is ERC721URIStorage contract: abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private ...
Yilmaz's user avatar
  • 1,610
0 votes
1 answer
26 views

VSC linter: Should be marked as Abstract

Can someone explain why contract ERC20_V1 is ERC20_STD, Ownership is being flagged inside of VSC with a warning of Contract "ERC20_V1" should be marked as abstract? I was under the ...
sltdev's user avatar
  • 117
2 votes
1 answer
853 views

How to interact with Ethernaut contracts via Remix

I'm going through the Ethernaut levels and I have some fundamental questions I need answered before I can continue. This question is particularly in reference to the levels that require you to deploy ...
skl_dev's user avatar
  • 21
1 vote
1 answer
388 views

OpenZeppelin Context.sol smart contract is abstract, why?

I was digging into this OZ smart contract: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol As you may see, it has only two functions to deal with metatxs....
Augusto Caro's user avatar
1 vote
1 answer
227 views

Why Pancakeswap declared the whole contract of SyrupBar in the MasterChef contract

Panacakeswap declared the whole of the syrupbar and cake token contracts code (methods and implementation, not even abstract contract) along side the Masterchef's contract code just to declare them as ...
boldrack's user avatar
0 votes
0 answers
130 views

Contract Marked As Abstract

I encounter an error specifying contract "FlashLoanReceiver.sol" should be marked as abstract. Is that means I missed the constructor line? Thank you for your kind help pragma solidity ^0.6....
Yllvar Djoni Anwar's user avatar
0 votes
1 answer
211 views

Factory pattern for multiple contracts inheriting from same abstract contract exceeds size

I have a base abstract contract which is inherited by 3 other contracts (all having the same interface). I am trying to use a factory contract to conditionally create instances of the derived ...
kautuk's user avatar
  • 1
1 vote
1 answer
3k views

What is the difference between the abstract and virtual keywords in Solidity?

Solidity has the keywords abstract and virtual. What is the difference?
Shane Fontaine's user avatar
1 vote
1 answer
2k views

Abstract contract not inheriting constructor from parent abstract contract

I'm using solidity 0.7.1 and I seem to be running into issues while inheriting from an abstract contract. Specifically with the open zeppelin library, now I'm not creating an issue there because their ...
Philogy's user avatar
  • 627
23 votes
3 answers
38k views

This contract may be abstract, not implement an abstract parent's methods completely or not invoke an inherited contract's constructor correctly

I'm trying to test out Ampleforth on Rinkbey using Remix. Here are all the files that I copy into remix. https://github.com/cryptoghoulz/based-contracts/tree/master/contracts/v4 They compile fine, but ...
Richard Garfield's user avatar
2 votes
1 answer
614 views

Can abstract contracts be initialized?

Solidity introduced abstract contractsin v0.6. Do they behave just like in all other languages? They can't be initialized, can they?
Paul Razvan Berg's user avatar
2 votes
1 answer
5k views

Error: This contract may be abstract

My solidity contract compiles in Remix, but when I try to deploy it it fails and throws Error: This contract may be abstract, not implement an abstract parent's methods completely or not invoke an ...
Lennard Mulder's user avatar
1 vote
4 answers
79 views

Issue deploying this contract

This is a contract im trying to deploy and i think its an abstract contract as most of the functions dont seem to be implemented... anyway the issue im facing is that truffle is telling me i cant ...
Sundeep Kumar's user avatar
2 votes
1 answer
736 views

abstract contract getting deployed instead of the main contract on truffle migrate

I'm building a project which consists of two .sol files -> A.sol and B.sol. Now, A.sol contains an abstract contract definition of B, among other things, like this: Contract B { function fnB() ...
Kombo's user avatar
  • 353
2 votes
2 answers
1k views

What are the benefits of abstract contracts?

I've seen similar questions, but none answer why people use abstract contracts. I come from a non-OOP JavaScript background, so I have some trouble understanding these things. From the docs: pragma ...
mesqueeb's user avatar
  • 555
2 votes
1 answer
202 views

possible to implement abstract base function with property in derived contract?

Is there any way to have an abstract base contract with an abstract function which gets implemented in a derived contract by a property (and not a function)? e.g. the following attempts failed: ...
SCBuergel's user avatar
  • 8,774
0 votes
2 answers
614 views

How to deploy a contract and its abstract/interface?

Assume I have a contract A: pragma solidity ^0.4.4; contract A{ struct St{ uint val; } function double(uint a)external returns (uint res){ res= 2*a; } } Let's call the above lines of ...
Aydin's user avatar
  • 2,117
1 vote
1 answer
410 views

Abstract delegate call

So there is a way to call other contract using abstract prototype of that contract. But what about delegate calls? I need to split my huge contract into separate pieces. So i can call my functions ...
Bohdan Millers's user avatar
0 votes
2 answers
2k views

What are abstract contracts?

I found the following case below in a book. case 1: contract sample1{ function a() returns (int b); } contract sample2{ function myFunc() { sample1 s = sample1(...
sihyun's user avatar
  • 1
6 votes
1 answer
9k 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 (...
skarred14's user avatar
  • 945