I am a new comer to the Ethereum and I am writing a piece of smart contract for my project. I used Win 10 and Mist 0.8.8 with the testnet that started with "R".
The contract code has the functions of changing the state and some modifier, however, after I launched the contract, I am not able to run any functions of it. The following errors show up. Thank you so much!!!
The contract code is show below: Thank you so much!
pragma solidity ^0.4.6;
contract FairTrade {
/* Variables */
address public creater;
address public trader;
address public framer;
address public preieumHandler;
/* State handling */
enum State { Paying, Transporting, Received, Completed }
State public state;
/* Contructor */
function FairTrade(address _trader, address _framer, address _preieumHandler,
uint _price, uint _quantity) {
creater = msg.sender;
trader = _trader;
framer = _framer;
preieumHandler = _preieumHandler;
}
/* Modifiers */
modifier onlyFramer {
if (msg.sender != framer) throw ; else _;
}
modifier onlyTrader {
if (msg.sender != trader) throw; else _;
}
modifier inState(State s) {
if (state != s) throw; else _;
}
modifier notInState(State s) {
if (state == s) throw; else _;
}
/* Functions */
function completedPaid() onlyTrader {
state = State.Transporting;
}
function receivedGood() inState(State.Transporting) onlyFramer {
state = State.Received;
}
function paid() inState(State.Received) {
state = State.Completed;
}
}