Generate Smart Contract
Contract Preview
Contract Code
No contract code available. Please generate contract.
Terminal
Success and Errors
error[E0308]: mismatched types
--> src/lib.rs:13:33
|
13 | mint.freeze_authority = Some(ctx.accounts.authority.key());
| --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum \`COption\`, found enum \`Option\`
|
Fix: Add .into() to convert Option to COption
error[E0308]: mismatched types
--> src/lib.rs:14:31
|
14 | mint.mint_authority = Some(ctx.accounts.authority.key());
| ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum \`COption\`, found enum \`Option\`
|
Fix: Add .into() to convert Option to COption
error[E0609]: no field \`authority\`
--> src/lib.rs:71:30
|
71 | #[account(mut, has_one = authority)]
| ^^^^^^^^^ unknown field
Fix: Remove has_one check
For more information about errors:
rustc --explain E0308
rustc --explain E0609
Deployment Status
Contract on Solana Devnet
// Contract Details
Network: Solana Devnet
Contract Address: No Data Available
Compiler Version: Compiling solpg v0.1.0
Deployment Statistics
View your contract deployment metrics
Coming Soon...
Test Scenarios
Verify contract functionality with test cases
Initial Value
Should return 0 as initial value
it("should return 0 as initial value", async () => {
const storage = await SimpleStorage.deploy();
const value = await storage.getValue();
expect(value).to.equal(0);
});
Set Value
Should set and emit new value
it("should set and emit new value", async () => {
const storage = await SimpleStorage.deploy();
const tx = await storage.setValue(42);
await expect(tx)
.to.emit(storage, "ValueChanged")
.withArgs(42);
const value = await storage.getValue();
expect(value).to.equal(42);
});
Test Cases
Unit tests for contract functionality
Contract Deployment
Contract should deploy successfully
Initial State
Should initialize with correct state
Value Update
Should update value correctly
Event Emission
Should emit ValueChanged event