Skip to content

Commit

Permalink
update contract ids
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Jul 6, 2024
1 parent db34ffd commit 02e1c09
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 956 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl MyContract for Contract {

#[test]
fn test_success() {
let contract_id = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID .
let contract_id = 0x3a9a75a3dc04f160ec6e286144eeffb6dd73fc0b4235b1793aa656be02e69d9b; // AUTO-CONTRACT-ID .
let caller = abi(MyContract, contract_id);

let data = 1u64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl MyContract for Contract {

#[test]
fn test_success() {
let contract_id = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID .
let contract_id = 0xeea596d8fc4e55fb622fd36131eff0401ccfd9f2a211f7ce2d93f816ec0cb23f; // AUTO-CONTRACT-ID .
let caller = abi(MyContract, contract_id);
let result = caller.test_function("a");
assert(result == "a")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::hash::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x14ed3cd06c2947248f69d54bfa681fe40d26267be84df7e19e253622b7921bbe;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/array_of_structs_contract --release
const CONTRACT_ID = 0xb6a63cfbfdef36702cbec327c15629ec88c1c4acc5a3a350b127de8aebc49293; // AUTO-CONTRACT-ID ../../test_contracts/array_of_structs_contract --release

fn main() -> u64 {
let addr = abi(TestContract, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ use test_fuel_coin_abi::*;
#[cfg(experimental_new_encoding = false)]
const FUEL_COIN_CONTRACT_ID = 0xec2277ebe007ade87e3d797c3b1e070dcd542d5ef8f038b471f262ef9cebc87c;
#[cfg(experimental_new_encoding = true)]
const FUEL_COIN_CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/test_fuel_coin_contract --release
const FUEL_COIN_CONTRACT_ID = 0x1a88d0982d216958d18378b6784614b75868a542dc05f8cc85cf3da44268c76c; // AUTO-CONTRACT-ID ../../test_contracts/test_fuel_coin_contract --release

#[cfg(experimental_new_encoding = false)]
const BALANCE_CONTRACT_ID = 0xf6cd545152ac83225e8e7df2efb5c6fa6e37bc9b9e977b5ea8103d28668925df;
#[cfg(experimental_new_encoding = true)]
const BALANCE_CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release
const BALANCE_CONTRACT_ID = 0x0d5fb0c109082f5784f6cd5979d9d25cab2d7307baf4a7661dea7d285c970e9f; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release

fn main() -> bool {
let default_gas = 1_000_000_000_000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use balance_test_abi::BalanceTest;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xf6cd545152ac83225e8e7df2efb5c6fa6e37bc9b9e977b5ea8103d28668925df;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release
const CONTRACT_ID = 0x0d5fb0c109082f5784f6cd5979d9d25cab2d7307baf4a7661dea7d285c970e9f; // AUTO-CONTRACT-ID ../../test_contracts/balance_test_contract --release

fn main() -> bool {
let balance_test_contract = abi(BalanceTest, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use abi_with_tuples::{MyContract, Location, Person};
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xfdc14550c8aee742cd556d0ab7f378b7be0d3b1e6e086c097352e94590d4ed02;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/abi_with_tuples_contract --release
const CONTRACT_ID = 0x5517b7a26c5cbd631796958996ab33708b05282e5e366037efc5ff914682c2d6; // AUTO-CONTRACT-ID ../../test_contracts/abi_with_tuples_contract --release

fn main() -> bool {
let the_abi = abi(MyContract, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use basic_storage_abi::{BasicStorage, Quad};
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x94db39f409a31b9f2ebcadeea44378e419208c20de90f5d8e1e33dc1523754cb;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release
const CONTRACT_ID = 0xe3e3a00062ed46de91902cda85348b27b371158bb1d5b9a6ccebe7307be59ff4; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release

fn main() -> u64 {
let addr = abi(BasicStorage, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use contract_with_type_aliases_abi::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x0cbeb6efe3104b460be769bdc4ea101ebf16ccc16f2d7b667ec3e1c7f5ce35b5;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release
const CONTRACT_ID = 0x0bd9f9710b0815ce83f1b81614027e3c1ef300ea579b30824b323147dd369ecf; // AUTO-CONTRACT-ID ../../test_contracts/contract_with_type_aliases --release

fn main() {
let caller = abi(MyContract, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use dynamic_contract_call::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xd1b4047af7ef111c023ab71069e01dc2abfde487c0a0ce1268e4f447e6c6e4c2;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release
const CONTRACT_ID = 0xf9ff73e9e0ddc3517fd6fe493847b0572db0d8e7c3672c590103112b4a0d4e5a; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release

fn main() -> bool {
let the_abi = abi(Incrementor, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use storage_enum_abi::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xc601d11767195485a6654d566c67774134668863d8c797a8c69e8778fb1f89e9;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release
const CONTRACT_ID = 0x7bd5d774e220fa89a3c1b38005f921eb3189a47e3a316175545b7413f6901ec4; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release

fn main() -> u64 {
let caller = abi(StorageEnum, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use auth_testing_abi::AuthTesting;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xc2eec20491b53aab7232cbd27c31d15417b4e9daf0b89c74cc242ef1295f681f;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/auth_testing_contract --release
const CONTRACT_ID = 0xf3b68b9e2ade5b886f4d2bd22bbfd928d418f9532a3a185956c1ca472a04dc0e; // AUTO-CONTRACT-ID ../../test_contracts/auth_testing_contract --release

// should be false in the case of a script
fn main() -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use context_testing_abi::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x6054c11cda000f5990373a4d61929396165be4dfdd61d5b7bd26da60ab0d8577;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/context_testing_contract --release
const CONTRACT_ID = 0x73061043a4ada05fd79d45d33f4afe5a8e83726beda5310741008aa772512d97; // AUTO-CONTRACT-ID ../../test_contracts/context_testing_contract --release

fn main() -> bool {
let gas: u64 = u64::max();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use nested_struct_args_abi::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xe63d33a1b3a6903808b379f6a41a72fa8a370e8b76626775e7d9d2f9c4c5da40;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/nested_struct_args_contract --release
const CONTRACT_ID = 0x35f286cf49aa8ecab05e8f41852cb461145ec6e39205dbd073726922a49803e1; // AUTO-CONTRACT-ID ../../test_contracts/nested_struct_args_contract --release

fn main() -> bool {
let caller = abi(NestedStructArgs, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::hash::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x3bc28acd66d327b8c1b9624c1fabfc07e9ffa1b5d71c2832c3bfaaf8f4b805e9;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release
const CONTRACT_ID = 0xe44ef1c461fec5318ddf2d4b93308ebe5c8a354134d85b08770c0da0ad939d82; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release

fn main() -> bool {
let caller = abi(StorageAccess, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn test_foo() {

#[test(should_revert)]
fn test_fail() {
let contract_id = 0xfef18ef24b6cbfd66238fecc3c2704976fdf3177442712a3402b2ab666f12039; // AUTO-CONTRACT-ID .
let contract_id = 0x822c8d3672471f64f14f326447793c7377b6e430122db23b622880ccbd8a33ef; // AUTO-CONTRACT-ID .
let caller = abi(MyContract, contract_id);
let result = caller.test_function {}();
assert(result == false)
Expand Down
13 changes: 6 additions & 7 deletions test/update-contract-ids.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#! /bin/bash

CHANGES=$(git status --porcelain | wc -l)
if [ "$CHANGES" != "0" ]; then
echo "git state is not clean. commit or restore first."
exit
fi
# CHANGES=$(git status --porcelain | wc -l)
# if [ "$CHANGES" != "0" ]; then
# echo "git state is not clean. commit or restore first."
# exit
# fi

BOLD_RED='\033[1;31m'
BOLD_GREEN="\033[1;32m"
Expand Down Expand Up @@ -33,8 +33,7 @@ grep --include \*.sw -Hno "// AUTO-CONTRACT-ID" . -R | while read line ; do
echo -e "${BOLD_WHITE}$PROJ${NC}"

pushd "$FOLDER/.." >> /dev/null
CONTRACT_ID=($(cargo r -p forc --release -- contract-id --path $CONTRACT_ARGS 2> /dev/null))
CONTRACT_ID=${CONTRACT_ID[16]} # change here if the output of forc change
CONTRACT_ID=$(cargo r -p forc --release -- contract-id --path $CONTRACT_ARGS 2> /dev/null | grep -oP '0x[a-zA-Z0-9]{64}')

if [[ $CONTRACT_ID ]]; then
popd >> /dev/null
Expand Down

0 comments on commit 02e1c09

Please sign in to comment.