Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8 public constant TIMEOUTBLOCKS = 180;
- function drainStack(bytes32 _stack, bytes32 _counterStack)
- public
- returns (bool)
- {
- require(stacks[_stack].owner==msg.sender || stacks[_counterStack].owner==msg.sender );
- require(stackCounter[_counterStack]==_stack );
- require(counterOfStack[_stack]==_counterStack );
- require(lastActor[_stack]==msg.sender );
- require(block.number - lastBlock[_stack] >= TIMEOUTBLOCKS);
- require(mode[_stack]<9 );
- for(uint8 i=0;i<10;i++){
- if(mixedStack[_stack][i]>0){
- uint256 tempId = mixedStack[_stack][i];
- mixedStack[_stack][i]=0;
- SlammerTime slammerTimeContract = SlammerTime(slammerTime);
- slammerTimeContract.transferBack(msg.sender,tempId);
- }
- }
- FinishGame(_stack);
- mode[_stack]=9;
- delete mixedStack[_stack];
- delete stacks[_stack];
- delete stackCounter[_counterStack];
- delete stacks[_counterStack];
- delete lastBlock[_stack];
- delete lastActor[_stack];
- delete counterOfStack[_stack];
- delete round[_stack];
- delete commitBlock[_stack];
- delete commit[_stack];
- DrainStack(_stack,_counterStack,msg.sender);
- }
- event DrainStack(bytes32 stack,bytes32 counterStack,address sender);
Add Comment
Please, Sign In to add comment