use of org.aion.api.server.types.CompiledContr in project aion by aionnetwork.
the class ApiWeb3Aion method eth_compileSolidity.
public RpcMsg eth_compileSolidity(Object _params) {
String _contract;
if (_params instanceof JSONArray) {
_contract = ((JSONArray) _params).get(0) + "";
} else if (_params instanceof JSONObject) {
_contract = ((JSONObject) _params).get("contract") + "";
} else {
return new RpcMsg(null, RpcError.INVALID_PARAMS, "Invalid parameters");
}
@SuppressWarnings("unchecked") Map<String, CompiledContr> compiled = contract_compileSolidity(_contract);
JSONObject obj = new JSONObject();
for (String key : compiled.keySet()) {
CompiledContr cc = compiled.get(key);
obj.put(key, cc.toJSON());
}
return new RpcMsg(obj);
}
Aggregations