ThalaLabs / surf

Type-Safe TypeScript Interfaces & React Hooks for Aptos.
MIT License
42 stars 8 forks source link

Support private entry as randomness security #166

Closed networkdm closed 4 months ago

networkdm commented 4 months ago

Randomness APIs are enabled on devnet and testnet, and landing soon on mainnet. As security considerations, requiring functions using randomness to be private to prevent test and abort attacks.

ABIFunction currently only supports visibility: 'friend' | 'public' so ABIs such as Aptogotchi Random Mint (src and ABI) will got type checking error.

{
    "name": "create_aptogotchi",
    "visibility": "private",
    "is_entry": true,
    "is_view": false,
    "generic_type_params": [],
    "params": [
        "&signer"
    ],
    "return": []
}

I would like to introduce visibility 'private' as well. Let me know if need more tests or any consideration. Thank you for this DX project!

0xbe1 commented 4 months ago

@networkdm ser, just curious, what brings your attention to surf?

networkdm commented 4 months ago

Hi @0xbe1, I'm an EVM-based, and tools like Viem or Wagmi make building DeFi stuff way easier. Looking for an Aptos equivalent, like surf

0xbe1 commented 4 months ago

@networkdm welcome to aptos and surf, happy to see your contributions.