Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Solidity 0.6.x

127 views

Published on

New features - novas funcionalidades

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Solidity 0.6.x

  1. 1. Algumas Novidades da Vers�o 0.6.x Jeff Prestes - 2020-03-30
  2. 2. Agradecimentos e Creditos Apresenta��o baseada no material do prof. Gerard Persoon da Universidade de Ci�ncias Aplicadas de Haia Agrade�o do prof. Gerard por gentilmente compartilhar o material. Mais detalhes dos fontes originais de exemplo em: https://github.com/web3examples/ethereum/blob/master/solidity_examples/ Meus exemplos melhorados est�o em: https://github.com/jeffprestes/ethereum-examples-hague-univ/solidity_examples Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  3. 3. Tipos Globais https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_globaltypes.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  4. 4. Fun��es Fallback & Receive https://github.com/jeffprestes/ethereum-examples-hague-univ/blob/master/solidity_examples/sol6_fall backreceive.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  5. 5. Nova forma de excluir item de array https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_mapping.sol Usar ListParticipant.pop() ao inv�s de ListParticipant.length-- Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  6. 6. push N�o retorna mais o �ndice do novo elemento. Ali�s, push(novoValor) retorna nada. https://solidity.readthedocs.io/en/v0.6.0/types.html#array-members Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  7. 7. ABIEncoderV2 N�o � mais considerado experimental, s� mantiveram a sintaxe por retrocompatibilidade: https://solidity.readthedocs.io/en/v0.6.4/layout-of-source-files.html#abiencoderv2 N�o usar com o otimizador: https://solidity.readthedocs.io/en/v0.6.4/060-breaking-changes.html#yul-optimizer Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  8. 8. Novas features em heran�a: virtual e override https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_override.sol Este artigo explica em detalhes: https://forum.openzeppelin.com/t/how-we-plan-to-adopt-solidity-0-6-virtual-functions/2063 Aqui outros exemplos: https://solidity.readthedocs.io/en/v0.6.0/contracts.html#inheritance Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  9. 9. Multiplas sobrecargas de m�todo https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_overridemultiple.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  10. 10. M�todos Abstratos https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_abstract.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  11. 11. Melhoria no compilador: alerta de "shadowing" https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_shadowing.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  12. 12. Pol�mico: try catch https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_trycatch.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  13. 13. Casting de address para address payable https://github.com/jeffprestes/ethereum-examples-hague-univ/blob/master/solidity_examples/sol6_addr payablecasting.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  14. 14. Fatias de um array ou Array Slices https://github.com/web3examples/ethereum/blob/master/solidity_examples/sol6_slice.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  15. 15. Natspec - Pequena melhoria na doc gerada no retorno https://github.com/jeffprestes/ethereum-examples-hague-univ/blob/master/solidity_examples/sol6_nats pec.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  16. 16. Mudan�a de como obter Endere�os de fun��es externas https://github.com/jeffprestes/ethereum-examples-hague-univ/blob/master/solidity_examples/sol6_addr essexternal.sol Jeff Prestes https://linkedin.com/in/jeffprestes https://github.com/jeffprestes
  17. 17. That's all folks! https://linkedin.com/in/jeffprestes Mande PR ou d� uma estrela no repo dos exemplos https://github.com/jeffprestes E adicione-me no seu Linkedin

×