12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- const contratoUsoDeImagemABI = [
- {
- "constant": true,
- "inputs": [],
- "name": "nomeEmpresa",
- "outputs": [
- {
- "name": "",
- "type": "string"
- }
- ],
- "payable": false,
- "stateMutability": "view",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [],
- "name": "receberPeloUso",
- "outputs": [],
- "payable": true,
- "stateMutability": "payable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "qualAgente",
- "type": "address"
- }
- ],
- "name": "definirAgente",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "constant": false,
- "inputs": [
- {
- "name": "qualNomeDaEmpresa",
- "type": "string"
- }
- ],
- "name": "definirNomeDaEmpresa",
- "outputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [],
- "payable": false,
- "stateMutability": "nonpayable",
- "type": "constructor"
- }
- ];
- var contratoUsoDeImagem = web3.eth.contract(contratoUsoDeImagemABI).at("0x1c37800ff4a782685972f115b1f44c486ea4ad11");
- function obtemNomeEmpresa() {
- contratoUsoDeImagem.nomeEmpresa({from: contaUsuario, gas: 3000000, value: 0}, function (err, resultado) {
- if (err) {
- console.log("Erro");
- console.error(err);
- } else {
- console.log("Resultado");
- let objStatus = document.getElementById("spanNomeEmpresa");
- console.log(resultado);
- objStatus.innerText = resultado;
- }
- });
- }
|