# Define a constant for ONEWEEK in seconds
const int ONEWEEK 604800;
# Declare a storage variable king of type King (the object we created)
# Entry point for this script
assert(storage.king.end < NOW || AMOUNT > storage.king.bounty);
let address oldKing = storage.king.owner;
storage.king = new King(add(NOW, ONEWEEK), AMOUNT, SENDER);
transfer(oldKing, AMOUNT);