pragma solidity ^0.4.4;
pragma experimental ABIEncoderV2;
contract A {
struct Pixel {
address a;
uint64 b;
string c;
uint d;
}
mapping (uint => Pixel) pixels;
function storePixel(Pixel pixel) public {
pixels[pixel.d] = pixel;
}
function getPixels() constant public returns (Pixel pixel) {
return pixels[pixel.d];
}
}
I think that this: https://github.com/ethereum/solidity/pull/3272 should fix the problem but still getting the title error. If I delete the "storePixel" function or change it's scope to "internal" the code compiles but of course that is not the idea.
Any ideas ?
+1 Having the same issue too. Developing advanced apps in solidity is very frustrating.
Sorry, we are still working on the new experimental ABI encoder, please excuse any inconveniences.
Having the same issue
Still facing the same issue. Is there any workaround ??
pragma solidity ^0.4.19;
/** @title Employee Tracker. */
contract EmployeeTracker {
/** @enum Employee will be in any one of the state */
enum State { Active, Inactive, InNotice }
/** @struct Employee details struct */
struct Employee {
string id;
string name;
State state;
string salary;
}
Employee[] employees;
function addEmployee(Employee emp) public {
employees.push(emp);
}
}
I think the originally reported issue is fixed. @pradeeppadmarajaiah you can either use pragma experimental ABIEncoderV2; or not use structs as parameters or return values of non-internal functions.
@chriseth Thank you for the alternative fix. But there are circumstances, where we need have to struct as parameters in real time application. How to handle it that situation ??
I assume you meant "non-development" instead of "real time", is that right?
The thing is that structs as parameters are still an experimental feature, there is no way around it.
@chriseth Yes. I am planning to use it in real time. Is there any other way that i can group the attributes without struct currently ?
@pradeeppadmarajaiah sorry, I do not really understand and this issue is probably also not the best place for such a discussion. I would recommend either stack exchange or https://gitter.im/ethereum/solidity
Sorry to revive this old issue, but I'm encountering this error despite enabling the ABIEncoderV2.
A.sol:
pragma solidity ^0.4.19;
pragma experimental ABIEncoderV2;
contract A {
struct T {
byte x;
int y;
}
function f() public pure returns (T) {
return T(1, 2);
}
}
B.sol:
pragma solidity ^0.4.19;
pragma experimental ABIEncoderV2;
import './A.sol';
contract B {
function g(A a) public pure returns (A.T) {
return a.f();
}
}
Thanks, I created a new issue.
Most helpful comment
+1 Having the same issue too. Developing advanced apps in solidity is very frustrating.