Skip to content

Commit

Permalink
chore: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
fazzatti committed Jul 23, 2024
1 parent 0af3e16 commit 9774613
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions frontend/src/app/core/pages/contracts-create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,32 @@ export const ContractsCreate: React.FC = () => {
const codContractId = codClient.getContractId()
if (!codContractId) throw new Error('Invalid Contract ID')

console.log('Contract ID:', codContractId)
console.log('Asset ID:', asset.id)
console.log('Vault ID:', vault.id)
console.log('Yield Rate:', codParams.yieldRate)
console.log('Term:', codParams.term)
console.log('Min Deposit:', codParams.minDeposit)
console.log('Penalty Rate:', codParams.penaltyRate)
console.log('Compound:', codParams.compoundStep)
console.log('Token TOKEN_DECIMALS:', TOKEN_DECIMALS)

const contract = {
name: 'Yield-bearing Asset',
asset_id: asset.id.toString(),
vault_id: vault.id.toString(),
address: codClient.getContractId() || '',
address: codContractId || '',
yield_rate: Number(codParams.yieldRate),
term: Number(codParams.term),
min_deposit: Number(codParams.minDeposit) / TOKEN_DECIMALS,
penalty_rate: Number(codParams.penaltyRate),
compound: Number(codParams.compoundStep),
}

const contractCreated = await createContract(contract)
const contractCreated = await createContract(contract).catch(error => {
console.error('Error creating contract', error)
throw new Error('Error creating contract')
})

if (contractCreated) {
toast({
Expand Down

0 comments on commit 9774613

Please sign in to comment.