Skip to content

Commit

Permalink
New contract artifact added
Browse files Browse the repository at this point in the history
  • Loading branch information
vinird committed Sep 19, 2017
1 parent a263c72 commit 9b4c31b
Show file tree
Hide file tree
Showing 36 changed files with 680 additions and 2,382 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="ShowSplashScreenSpinner" value="false"/>
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
Expand Down
1,105 changes: 73 additions & 1,032 deletions resources/_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,101 changes: 55 additions & 1,046 deletions resources/_splash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-hdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-ldpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-mdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-xhdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-xxhdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/android/icon/drawable-xxxhdpi-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/icon.png.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
53a19e864fb910d029b337385ebbdae4
949b5dd22138a1c61048499069a01709
34 changes: 0 additions & 34 deletions src/app/app.component.js

This file was deleted.

1 change: 0 additions & 1 deletion src/app/app.component.js.map

This file was deleted.

54 changes: 0 additions & 54 deletions src/app/app.module.js

This file was deleted.

1 change: 0 additions & 1 deletion src/app/app.module.js.map

This file was deleted.

7 changes: 6 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { SplashScreen } from '@ionic-native/splash-screen';

// Added providers
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { UserContractProvider } from '../providers/user-contract/user-contract';
import { KevinContractProvider } from '../providers/kevin-contract/kevin-contract';

@NgModule({
declarations: [
Expand All @@ -38,7 +40,10 @@ import { InAppBrowser } from '@ionic-native/in-app-browser';
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
InAppBrowser
InAppBrowser,
UserContractProvider,
UserContractProvider,
KevinContractProvider,
]
})
export class AppModule {}
4 changes: 0 additions & 4 deletions src/app/main.js

This file was deleted.

1 change: 0 additions & 1 deletion src/app/main.js.map

This file was deleted.

77 changes: 77 additions & 0 deletions src/assets/contracts-artifacts/ContractKevin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"contract_name": "ContractKevin",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "w",
"type": "string"
}
],
"name": "setWord",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getWord",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"inputs": [
{
"name": "_word",
"type": "string"
}
],
"payable": false,
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "a",
"type": "address"
}
],
"name": "Changed",
"type": "event"
}
],
"unlinked_binary": "0x6060604052341561000f57600080fd5b60405161044d38038061044d8339810160405280805190910190505b600081805161003e929160200190610066565b50602a60015560028054600160a060020a03191633600160a060020a03161790555b50610106565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a757805160ff19168380011785556100d4565b828001600101855582156100d4579182015b828111156100d45782518255916020019190600101906100b9565b5b506100e19291506100e5565b5090565b61010391905b808211156100e157600081556001016100eb565b5090565b90565b610338806101156000396000f300606060405263ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663cd048de68114610048578063ed40a8c81461009b575b600080fd5b341561005357600080fd5b61009960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061012695505050505050565b005b34156100a657600080fd5b6100ae6101b1565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100eb5780820151818401525b6020016100d2565b50505050905090810190601f1680156101185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6002543373ffffffffffffffffffffffffffffffffffffffff90811691161461014e57600080fd5b600081805161016192916020019061025a565b507feb63daa74e21898ac31061df2ff66f5092827dd7c80827d30613275236af58de3360405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a15b5b50565b6101b96102d9565b60008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561024f5780601f106102245761010080835404028352916020019161024f565b820191906000526020600020905b81548152906001019060200180831161023257829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061029b57805160ff19168380011785556102c8565b828001600101855582156102c8579182015b828111156102c85782518255916020019190600101906102ad565b5b506102d59291506102eb565b5090565b60206040519081016040526000815290565b61025791905b808211156102d557600081556001016102f1565b5090565b905600a165627a7a72305820d0ef6dd8f74acfd7319abbda901a849c394b4985133b4654900e2ca5a7f36f610029",
"networks": {
"1505583672606": {
"events": {
"0xeb63daa74e21898ac31061df2ff66f5092827dd7c80827d30613275236af58de": {
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "a",
"type": "address"
}
],
"name": "Changed",
"type": "event"
}
},
"links": {},
"address": "0x5bb7b684b21b32f98b34b341131ec305bad97991",
"updated_at": 1505789653966
}
},
"schema_version": "0.0.5",
"updated_at": 1505789653966
}
90 changes: 90 additions & 0 deletions src/assets/contracts-artifacts/TextContract.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"contract_name": "TextContract",
"abi": [
{
"constant": false,
"inputs": [],
"name": "getAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "w",
"type": "string"
}
],
"name": "setWord",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getWord",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"inputs": [
{
"name": "_word",
"type": "string"
}
],
"payable": false,
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "a",
"type": "address"
}
],
"name": "Changed",
"type": "event"
}
],
"unlinked_binary": "0x6060604052341561000f57600080fd5b6040516104b13803806104b18339810160405280805190910190505b600081805161003e929160200190610066565b50602a60015560028054600160a060020a03191633600160a060020a03161790555b50610106565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100a757805160ff19168380011785556100d4565b828001600101855582156100d4579182015b828111156100d45782518255916020019190600101906100b9565b5b506100e19291506100e5565b5090565b61010391905b808211156100e157600081556001016100eb565b5090565b90565b61039c806101156000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166338cc48318114610053578063cd048de61461008f578063ed40a8c8146100e2575b600080fd5b341561005e57600080fd5b61006661016d565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b341561009a57600080fd5b6100e060046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061018a95505050505050565b005b34156100ed57600080fd5b6100f5610215565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101325780820151818401525b602001610119565b50505050905090810190601f16801561015f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60025473ffffffffffffffffffffffffffffffffffffffff165b90565b6002543373ffffffffffffffffffffffffffffffffffffffff9081169116146101b257600080fd5b60008180516101c59291602001906102be565b507feb63daa74e21898ac31061df2ff66f5092827dd7c80827d30613275236af58de3360405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a15b5b50565b61021d61033d565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102b35780601f10610288576101008083540402835291602001916102b3565b820191906000526020600020905b81548152906001019060200180831161029657829003601f168201915b505050505090505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102ff57805160ff191683800117855561032c565b8280016001018555821561032c579182015b8281111561032c578251825591602001919060010190610311565b5b5061033992915061034f565b5090565b60206040519081016040526000815290565b61018791905b808211156103395760008155600101610355565b5090565b905600a165627a7a723058204d65ea148ea89642450800ae320c0123b54b48e8c2154f132f18ac0284cc461f0029",
"networks": {
"1505583672606": {
"events": {
"0xeb63daa74e21898ac31061df2ff66f5092827dd7c80827d30613275236af58de": {
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "a",
"type": "address"
}
],
"name": "Changed",
"type": "event"
}
},
"links": {},
"address": "0xe4dbc9b58cbca82a888107c98b7c347c157a5814",
"updated_at": 1505795196360
}
},
"schema_version": "0.0.5",
"updated_at": 1505795196360
}
Binary file added src/assets/img/square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 66 additions & 0 deletions src/assets/js/truffle-contract-artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
var Web3 = require('web3');
var web3 = new Web3();

var host = "http://159.203.0.218:8545";

App = {
web3Provider: null,
contracts: {},

init: function() {
return App.initWeb3();
},

// Init Web3 provider ////////////////////////////////////////////
initWeb3: function() {
// Inicializa web3 y apunta el proveedor hacia testRPC.
// escoja el proveedor específico de Web3.providers
App.web3Provider = new Web3.providers.HttpProvider(host);
web3 = new Web3(App.web3Provider);
// console.log("Web3 new instance " + web3)
// console.log(web3)
try {
console.log("Blockchain is listening: " + web3.net.listening);
} catch (err) {
console.log("Error " + err)
}
return App.initContract();
},

// Init contract ////////////////////////////////////////////////
initContract: function() {
$.getJSON('./assets/contracts-artifacts/User.json', function(data) {
// Get the necessary contract artifact file and instantiate it with truffle-contract.
var UserArtifact = data;
App.contracts.User = TruffleContract(UserArtifact);

// Set the provider for our contract.
App.contracts.User.setProvider(App.web3Provider);
});

$.getJSON('./assets/contracts-artifacts/TextContract.json', function(data) {
// Get the necessary contract artifact file and instantiate it with truffle-contract.
var KevinArtifact = data;
App.contracts.Kevin = TruffleContract(KevinArtifact);

// Set the provider for our contract.
App.contracts.Kevin.setProvider(App.web3Provider);
App.contracts.Kevin.defaults({
from: "0x584a104e03db1199be9d11c579d56c73bc0267af"
});
// console.log(App.contracts.Kevin.defaults)
});
},

// Get contracts //////////////////////////////////////////
getUserContract: function() {
return App.contracts.User;
},
getKevinContract: function() {
return App.contracts.Kevin;
}
}

window.onload = function() {
App.init();
};
Loading

0 comments on commit 9b4c31b

Please sign in to comment.