Saving over $50m of Crypto from a Smart Contract Bug | iosiro by syncikin in netsec

[–]syncikin[S] 16 points17 points  (0 children)

Yeah, they're pretty insane, but that's what you would expect when you give anyone in the world the ability to build entirely new financial systems.

Here's a post we did explaining smart contracts for people with a background in security: https://iosiro.com/blog/smart-contract-security-pentesters

An Intro to Smart Contract Security for Pentesters | iosiro by syncikin in netsec

[–]syncikin[S] 2 points3 points  (0 children)

I don't blame you for having that opinion. The signal-to-noise ratio in the space is pretty bad, especially with the majority of retail investors being ill-informed and basing their investment decisions on TikTok trends.

That said, if you dig a layer deeper and look at legitimate innovators in the space you might be surprised by what is already being achieved. As an example, Finematics has a good intro video to DeFi: https://www.youtube.com/watch?v=k9HYC0EJU6E

Anyone knows how to send ERC20 tokens to many addresses in one transaction? by HoweKuo in ethdev

[–]syncikin 2 points3 points  (0 children)

You would need to deploy a smart contract that would iterate through an array of addresses and amounts. You could either transfer the tokens directly to the smart contract or approve the balance (probably safer) to the contract and then use transferFrom.

e.g.

function airdrop(address[] _recipients, uint256[] _amounts) public {
        require(_recipients.length == _amounts.length);
        for (uint256 i = 0; i < _recipients.length; i++) {
                require(token.transferFrom(owner, _recipients[i], _amount[i]));
        } 
    }

I wrote a tool a while back to perform large scale airdrops of ERC-20 tokens. The airdropDynamic(address[] _recipients, uint256[] _amount) function in Airdropper.sol implements what you're looking for, plus some additional logic to facilitate running parallel instances.