Added loading indicator, and changed contract addresses

This commit is contained in:
Richard Ramos 2018-09-14 13:30:26 -04:00
parent e50c9870ae
commit fd6e7c994e
4 changed files with 87 additions and 21 deletions

View File

@ -31,8 +31,8 @@ module.exports = {
"currency": "USD"
}
},
"0xd7879e4401c548544196dc0215df449B2a1E23B3": {
"name": "Status Test Token",
"0x121a430A73Fc13e2D6d4a9dc3E943de647c30f8f": {
"name": "Status Gas Relayer Test Token",
"symbol": "SNT",
"minAccepted":{
"value": 1,
@ -46,7 +46,7 @@ module.exports = {
"IdentityGasRelay": {
"abiFile": "../abi/IdentityGasRelay.json",
"isIdentity": true,
"factoryAddress": "0x7F106A1Bc637AC4AAed3DC72582749c4562D4323",
"factoryAddress": "0x89976FeEC7CFDF2DF5194e363FD2a3388e2DC91A",
"kernelVerification": "isKernel(bytes32)",
"allowedFunctions": [
{
@ -63,7 +63,7 @@ module.exports = {
"SNTController": {
"abiFile": "../abi/SNTController.json",
"isIdentity": false,
"address": "0xA77A1014F55157c3119FB3f53E653E42f8fa634c",
"address": "0xf558aC91312821B0E1802567BC785355AA811783",
"allowedFunctions": [
{
"function":"transferSNT(address,uint256,uint256,uint256,bytes)"

View File

@ -60,6 +60,7 @@ class Status extends Component {
'block': 0,
'submitState': {
'etherSend': false,
'changeSNTController': false,
'generateSTT': false
}
};
@ -158,6 +159,12 @@ class Status extends Component {
changeSNTController = event => {
event.preventDefault();
let submitState = this.state.submitState;
submitState.changeSNTController = true;
this.setState({submitState});
const toSend = STT.methods.changeController(SNTController.options.address);
toSend.estimateGas()
@ -166,6 +173,9 @@ class Status extends Component {
})
.then(receipt => {
console.log(receipt);
submitState = this.state.submitState;
submitState.changeSNTController = false;
this.setState({submitState});
});
}
@ -173,7 +183,7 @@ class Status extends Component {
event.preventDefault();
let submitState = this.state.submitState;
submitState.etherSend = false;
submitState.etherSend = true;
this.setState({submitState});
web3.eth.sendTransaction({from: web3.eth.defaultAccount, to: this.props.relayerAddress, value: web3.utils.toWei('1', "ether")})

View File

@ -51,12 +51,12 @@ module.exports = {
"IdentityKernel": {"deploy": false},
"STT": {
"instanceOf": "TestMiniMeToken",
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Test Token", 18, "STT", true],
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Gas Relayer Test Token", 18, "STT", true],
"gasLimit": 4000000
},
"SNTController": {
"args": ["0x5f803F54679577fC974813E48abF012A243dD439", "$STT"]
},
},
"IdentityGasRelay": {
"deploy": true,
"args": [[], [], [], 1, 1, "0x0000000000000000000000000000000000000000"]
@ -73,31 +73,32 @@ module.exports = {
},
testnet: {
contracts: {
//
"MiniMeTokenFactory": {
"address": "0xBda00586BF6D79F22203EeDe046DEcaaf2B771B4"
"address": "0xD1A2f3726331d6100E8BcD1484EdF796B0b20cc9"
},
"STT": {
"instanceOf": "TestMiniMeToken",
"address": "0xd7879e4401c548544196dc0215df449B2a1E23B3"
"address": "0x121a430A73Fc13e2D6d4a9dc3E943de647c30f8f"
},
"SNTController": {
"address": "0xA77A1014F55157c3119FB3f53E653E42f8fa634c"
"address": "0xf558aC91312821B0E1802567BC785355AA811783"
},
"IdentityGasRelay": {
"address": "0xEA60E967BA16Bf4313B5d23b78e44763C8928C67"
"address": "0x4b571c5e75E93F53E985b12A3D107318178b9B5F"
},
"IdentityFactory": {
"address": "0x7F106A1Bc637AC4AAed3DC72582749c4562D4323"
"address": "0x89976FeEC7CFDF2DF5194e363FD2a3388e2DC91A"
},
"TestContract": {
"address": "0x1F0C9ebD14Ba43BDD5b43C52EbEfc31066704988"
"address": "0xa7aeF1cd3e4a8425D9A1E13B5557908895dCbdBE"
}
// If needed to deploy contracts again, uncomment the following lines
/*
"MiniMeTokenFactory": {"args":[]},
"STT": {
"instanceOf": "MiniMeToken",
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Test Token", 18, "STT", true],
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Gas Relayer Test Token", 18, "STT", true],
"gasLimit": 4000000
},
"SNTController": {
@ -114,9 +115,7 @@ module.exports = {
},
"TestContract": {
"args": ["$STT"]
}
*/
},
accounts: [{privateKey: "71DB9B832BF457B4D812D6D6D673A02A1A2F5F687DBF59A2E41302A43459153C"}]
}
}*/
}
}
};

View File

@ -1,5 +1,47 @@
pragma solidity ^0.4.23;
/*
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
INTENTIONALLY INSECURE DO NOT USE IN MAINNET
*/
/*
Copyright 2016, Jordi Baylina
@ -26,7 +68,6 @@ pragma solidity ^0.4.23;
* @dev It is ERC20 compliant, but still needs to under go further testing.
*/
import "../common/Controlled.sol";
import "../token/TokenController.sol";
import "../token/ApproveAndCallFallBack.sol";
import "../token/MiniMeTokenInterface.sol";
@ -37,7 +78,7 @@ import "../token/MiniMeTokenFactory.sol";
* that deploys the contract, so usually this token will be deployed by a
* token controller contract, which Giveth will call a "Campaign"
*/
contract TestMiniMeToken is MiniMeTokenInterface, Controlled {
contract TestMiniMeToken is MiniMeTokenInterface {
string public name; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals; //Number of decimals of the smallest unit
@ -86,6 +127,20 @@ contract TestMiniMeToken is MiniMeTokenInterface, Controlled {
// The factory used to create new clone tokens
MiniMeTokenFactory public tokenFactory;
modifier onlyController {
require(msg.sender == controller);
_;
}
address public controller;
/// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract
function changeController(address _newController) public {
controller = _newController;
}
////////////////
// Constructor
////////////////
@ -116,6 +171,8 @@ contract TestMiniMeToken is MiniMeTokenInterface, Controlled {
)
public
{
controller = msg.sender;
tokenFactory = MiniMeTokenFactory(_tokenFactory);
name = _tokenName; // Set the name
decimals = _decimalUnits; // Set the decimals