diff --git a/contracts/currency/currency.cpp b/contracts/currency/currency.cpp index 959cce83075c11ee9bf5828b0d380f98e1bbac19..699db572bff8a0ed4e1ace8593a3647fbfc37f2f 100644 --- a/contracts/currency/currency.cpp +++ b/contracts/currency/currency.cpp @@ -39,7 +39,11 @@ using namespace TOKEN_NAME; extern "C" { void init() { - store_account( N(currency), account( currency_tokens(1000ll*1000ll*1000ll) ) ); + account owned_account; + //Initialize currency account only if it does not exist + if ( !accounts::get( owned_account, N(currency) )) { + store_account( N(currency), account( currency_tokens(1000ll*1000ll*1000ll) ) ); + } } /// The apply method implements the dispatch of events to this contract diff --git a/contracts/infinite/infinite.cpp b/contracts/infinite/infinite.cpp index 02176133f5891f89a7644cbd166f9634ebf46530..47ff1f8e156436cbc7bb197a116ab54a4e892203 100644 --- a/contracts/infinite/infinite.cpp +++ b/contracts/infinite/infinite.cpp @@ -41,7 +41,11 @@ using namespace infinite; extern "C" { void init() { - store_account( N(currency), account( currency_tokens(1000ll*1000ll*1000ll) ) ); + account owned_account; + //Initialize currency account only if it does not exist + if ( !accounts::get( owned_account, N(currency) )) { + store_account( N(currency), account( currency_tokens(1000ll*1000ll*1000ll) ) ); + } } /// The apply method implements the dispatch of events to this contract diff --git a/contracts/storage/storage.cpp b/contracts/storage/storage.cpp index 4bffa7a3d4fe1255a172a98ec816b3d87d83a1a6..b31ebd58678913341b34ed7087a009b2521138c0 100644 --- a/contracts/storage/storage.cpp +++ b/contracts/storage/storage.cpp @@ -101,8 +101,12 @@ using namespace TOKEN_NAME; extern "C" { void init() { - // How do we initialize the storage capacity? By how much here? - accounts::store( account( storage_tokens(1000ll*1000ll*1000ll) ), N(storage) ); + account owned_account; + //Initialize storage account only if it does not exist + if ( !accounts::get( owned_account, N(storage) )) { + // How do we initialize the storage capacity? By how much here? + accounts::store( account( storage_tokens(1000ll*1000ll*1000ll) ), N(storage) ); + } } /// The apply method implements the dispatch of events to this contract