Can't access abstract contract object when requiring MyContract.sol.js
See original GitHub issueHi. I am trying to use a custom build process but I am having difficulty accessing the contract object after the load in order to call new
.
This is what I have working so far:
const Pudding = require('ether-pudding')
const MyContract = require('../environments/development/contracts/MyContract.sol.js')
MyContract.load(Pudding)
When I try to run MyContract.new({ from: web3.eth.accounts[0] })
I get:
TypeError: Cannot read property 'apply' of undefined
at Function.Contract.new (../environments/development/contracts/MyContract.sol.js:38:32)
Which is this code:
Contract.new = function() {
if (Contract.Pudding == null) {
throw new Error("MyContract error: Please call load() first before calling new().");
}
// Error occurs here, stating that 'new' is undefined
return Contract.Pudding.new.apply(Contract, arguments);
};
What am I missing?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Is there any way to access abstract contract in web3?
I want to use interface of ERC20 in my dapp and users will be able to enter the valid addresses of existing ERC20...
Read more >Solidity - Abstract Contract - GeeksforGeeks
An instance of an abstract cannot be created. Abstract contracts are used as base contracts so that the child contract can inherit and ......
Read more >web3.js contract object re-design · Issue #68 · ethereum/EIPs
Abstract. This proposal is a move to make it a more future proof javascript representation of a ethereum smart contract.
Read more >Solidity: How to know when to use Abstract Contracts vs ...
Contracts are identified as abstract contracts when at least one of their functions lacks an implementation. As a result, they cannot be compiled....
Read more >Accessing events from interface contract - Event doesn't exist ...
Yes you have to declare the event inside your contract for accessing it externally. As an example, consider the ERC20 smart-contract's solidity code...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Problem solved when I switched to ether-pudding v2.x. Thanks!
👏