-
-
Save gnidan/c653c57a69adf50f5d60b7d0c1d3c6a2 to your computer and use it in GitHub Desktop.
Introducing Truffle DB (supplementary material)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# concept: example query | |
# looks up specific information about the deployed KittySharesToken contract | |
{ | |
network(name: "mainnet") { | |
contract(name: "KittySharesToken") { | |
name | |
abi { | |
json # e.g. [{"constant":false,"inputs":[{"name":"n",...}],...]" | |
} | |
deployed { | |
address # e.g. "0x8009bE70a9c2bcc7E29eF63dcEFdd92794f46be3" | |
constructor { | |
arguments # e.g. { name: "KittyShares", symbol: "🐱" } | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"artifacts": { | |
"contract": { | |
"name": "MagicSquare", | |
"abi": { | |
"json": "[{\"constant\":false,\"inputs\":[{\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"generateMagicSquare\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSquare\",\"outputs\":[{\"components\":[{\"name\":\"rows\",\"type\":\"uint256[][]\"},{\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"square\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "MagicSquare" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query GetNameAndAbi($name: String!) { | |
artifacts { | |
contract(name: $name) { | |
name | |
abi { | |
json | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment