fix(contracts): rewrite contract saving func

Viacheslav Sukhovieiev requested to merge demo/slava/small_fixes_3 into main

Merge request reports