0

Is it possible ina contract to freeze an account for a specific period of time, 1 month in example, after a transaction, let say the user sends 1 ETH to my contract and he can't do another transaction for a month?

0

You can prevent the account from doing any transactions, but you can prevent interactions with your contract. E.g. the following should only allow a contract to send ether to the contract if it's been at least 30 days since the account's last transfer. (This code is completely untested.)

contract Freezing {
    mapping(address => uint256) lastDeposit;

    function deposit() public payable {
        require(lastDeposit[msg.sender] + 30 days < now);

        lastDeposit[msg.sender] = now;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.