Skip to content

Commit 09c2d8b

Browse files
committed
refactor: remove admin signer check from deploy_all function and related test
1 parent 06a9f6c commit 09c2d8b

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

apps/smart-contracts/contracts/deployer/src/deployer.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ impl DeployerContract {
201201
/// 4. Transfer token-sale admin to params.token_sale_admin via `set_admin`
202202
/// 5. Deploy vault-contract pointing to the participation-token
203203
pub fn deploy_all(env: Env, signer: Address, params: DeployAllParams) -> DeployedContracts {
204-
let admin: Address = env.storage().instance().get(&DataKey::Admin).unwrap();
205-
if signer != admin {
206-
panic!("Signer must be the contract admin");
207-
}
208204
signer.require_auth();
209205

210206
let participation_token_wasm: BytesN<32> = env

apps/smart-contracts/contracts/deployer/src/test.rs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -149,45 +149,6 @@ fn test_deploy_all() {
149149
assert_ne!(result.token_sale, result.vault_contract);
150150
}
151151

152-
#[test]
153-
#[should_panic(expected = "Signer must be the contract admin")]
154-
fn test_deploy_all_rejects_non_admin_signer() {
155-
let env = Env::default();
156-
env.mock_all_auths();
157-
158-
let admin = Address::generate(&env);
159-
let non_admin = Address::generate(&env);
160-
let escrow_contract = Address::generate(&env);
161-
let vault_admin = Address::generate(&env);
162-
let token_sale_admin = Address::generate(&env);
163-
let usdc = Address::generate(&env);
164-
let deployer = setup_deployer(&env, &admin);
165-
166-
let token_sale_salt = BytesN::from_array(&env, &[10u8; 32]);
167-
let participation_salt = BytesN::from_array(&env, &[11u8; 32]);
168-
let vault_salt = BytesN::from_array(&env, &[12u8; 32]);
169-
170-
deployer.deploy_all(
171-
&non_admin,
172-
&DeployAllParams {
173-
participation_salt,
174-
token_sale_salt,
175-
vault_salt,
176-
token_name: String::from_str(&env, "CampaignToken"),
177-
token_symbol: String::from_str(&env, "CAMP"),
178-
decimal: 7u32,
179-
escrow_contract,
180-
vault_admin,
181-
vault_enabled: true,
182-
roi_percentage: 5i128,
183-
usdc,
184-
token_sale_admin,
185-
hard_cap: 1_000_000i128,
186-
max_per_investor: 10_000i128,
187-
}
188-
);
189-
}
190-
191152
#[test]
192153
fn test_update_wasm() {
193154
let env = Env::default();

0 commit comments

Comments
 (0)