Open jorisbontje opened 8 years ago
The token registry has a getToken
which returns the value as an address. @mhhf would know if our DSL would support casting it to an address, and could diagnose the dappfile issue.
if I replace get
with getToken
; then I run into https://github.com/nexusdev/dapple/issues/218
$ dapple run deploy_mock.ds
Using local solc installation...
Deploying to environment "default"...
Connected to RPC client, block height is 19
simulated successfully
DEPLOYED: MakerUserMockRegistry = 0x6f19b7c6a78c9195e55c0f9515eb121a7896091b
GAS COST: 2485259 for "new MakerUserMockRegistry"
CONFIRMED deploy after 1 blocks!
.
could not unlock signer account
var eth_frontend = mock_registry.get('ETH') export eth_frontend
Since here a bytes32 or address is returned, dapple don't have a default way to infer the correct contract type to this. Also only exports of object types (address + class ) are supported atm. We should discuss the support of this feature along with DappleScript's type system here: https://github.com/nexusdev/dapple/issues/227
Is this mandatory or just something you run up into?
DSToken
which should be exportable by denis's explanation@nmushegian while this is true for the code and solidity_interface:
[...]
function getToken(bytes32 symbol) internal constant returns (DSToken t) {
return _M.getToken(symbol);
}
[...]
The contract ABI isn't contract type aware:
[...]
{
"constant": false,
"inputs": [
{
"name": "symbol",
"type": "bytes32"
}
],
"name": "getToken",
"outputs": [
{
"name": "",
"type": "address"
}
],
"type": "function"
}
[...]
So for an inference(export), some sort of custom interface parsing has to be done.
In my quest to get a working devnet deployment of Maker, I have created the following deployment script (
deploy_mock.ds
):After execution, I get the promising result:
After manually removing trailing zeroes; I even get contract code at the returned addresses!
However the generated
dappfile
is rather messed up:Am I doing this right? Is there a way to cast returned values to addresses; and how should I run this to create a valid dappfile?