Skip to main content

You can do this by calling address.balance. To get the contract's balance, just do this.balance. Read the docs.

Update: As of Solidity ^0.4.24, you need to do:

address(this).balance

(Copied from answer by Paul Berg)

You can do this by calling address.balance. To get the contract's balance, just do this.balance. Read the docs.

You can do this by calling address.balance. To get the contract's balance, just do this.balance. Read the docs.

Update: As of Solidity ^0.4.24, you need to do:

address(this).balance

(Copied from answer by Paul Berg)

Source Link
0xcaff
  • 2.5k
  • 1
  • 15
  • 29

You can do this by calling address.balance. To get the contract's balance, just do this.balance. Read the docs.