Questions tagged [abstract]
The abstract tag has no usage guidance.
20
questions
0
votes
1
answer
20
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 ...
0
votes
1
answer
13
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 ...
0
votes
1
answer
317
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 ...
1
vote
1
answer
248
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....
1
vote
1
answer
189
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 ...
0
votes
0
answers
92
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....
0
votes
1
answer
87
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 ...
1
vote
1
answer
2k
views
What is the difference between the abstract and virtual keywords in Solidity?
Solidity has the keywords abstract and virtual. What is the difference?
0
votes
1
answer
708
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 ...
12
votes
3
answers
23k
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 ...
1
vote
1
answer
485
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?
2
votes
1
answer
4k
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 ...
1
vote
4
answers
75
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 ...
2
votes
1
answer
686
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() ...
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 ...
2
votes
1
answer
180
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:
...
0
votes
2
answers
361
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 ...
1
vote
1
answer
357
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 ...
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(...
5
votes
1
answer
7k
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 (...