Skip to content

Instantly share code, notes, and snippets.

@afzaal-ahmad-zeeshan
Created May 3, 2020 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afzaal-ahmad-zeeshan/44ba7086a7731cb206b561e25cdf94f1 to your computer and use it in GitHub Desktop.
Save afzaal-ahmad-zeeshan/44ba7086a7731cb206b561e25cdf94f1 to your computer and use it in GitHub Desktop.
pragma solidity ^0.5.17;
contract RemoteInterface {
function setTeamContract(address contractAddress) public;
function getMyTeamContract() public view returns (address);
function getCellTeamNumber(uint index) public view returns (int);
function getMyTeamCount() public view returns (int);
function getCellHashFromContract(uint index) public returns (bytes32);
function setCellFromContract(uint index, bytes32 nonce) public payable returns (bytes32);
}
contract ClientTeam1 {
address remote_address = 0xC963848BD0B7373DA4f97d4D258b318DfCaC2662;
RemoteInterface rInterface;
constructor() public {
rInterface = RemoteInterface(remote_address);
}
function getMyTeamContract() public view returns (address teamAddress) {
return rInterface.getMyTeamContract();
}
function setMyTeamContract(address teamAddress) public {
rInterface.setTeamContract(teamAddress);
}
function getCellTeamNumber(uint index) public view returns (int) {
return rInterface.getCellTeamNumber(index);
}
function getMyTeamCount() public view returns (int) {
return rInterface.getMyTeamCount();
}
function getCellHashFromContract(uint index) public returns (bytes32) {
return rInterface.getCellHashFromContract(index);
}
function setCellFromContract(uint index, bytes32 nonce) public payable returns (bytes32) {
return rInterface.setCellFromContract.value(0.5 ether)(index, nonce);
}
function greet() public pure returns (string memory greeting) {
return "Hello from Team 1";
}
}
[
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getCellHashFromContract",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "getCellTeamNumber",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getMyTeamContract",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getMyTeamCount",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "ownerGetCell",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "ownerGetCellHashInBulk",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ownerGetNumberTeams",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ownerGetSprintNumber",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "int256",
"name": "teamNumber",
"type": "int256"
}
],
"name": "ownerGetTeamAccount",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "teamNumber",
"type": "uint256"
}
],
"name": "ownerGetTeamConnected",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "int256",
"name": "teamNumber",
"type": "int256"
}
],
"name": "ownerGetTeamContract",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "int256",
"name": "index",
"type": "int256"
}
],
"name": "ownerGetTeamCountsAt",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "ownerStartNewSprint",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "nonce",
"type": "bytes32"
}
],
"name": "setCellFromContract",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "contractAddress",
"type": "address"
}
],
"name": "setTeamContract",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment