---
# System prepended metadata

title: 'Counter Decrement Task (Copied from Maciej: https://hackmd.io/cQv6dTRFS5W7bE-zpwYCeA)'

---

# Counter Decrement Task (Copied from Maciej: https://hackmd.io/cQv6dTRFS5W7bE-zpwYCeA)

1. Fork the Github repository https://github.com/casper-ecosystem/counter.
2. Develop on a new branch `decrement`, that starts from the `upgrade` branch.
3. Add `counter-v3-decrement.rs` contract.
    - It should be based on the `counter_v2_reset.rs`.
    - It should include additional endpoint `decrement`, that taken no arguments.
    - Calling the `decrement` endpoint should reduce the value of the counter by 1.
    - Use `storage::write` to update the value of the counter.
    - Contract should fail when decrementing below zero.
4. Implement following v3 tests in `interation_tests.rs`.
    ```rust
    #[test]
    fn should_decremenet_in_v3() {
        
    }

    #[test]
    #[should_panic]
    fn should_fail_when_decrementing_below_zero_in_v3() {
        
    }
    ```
5. Send your repository link to CasperLabs via Zoom.
