Abel had witness borne to him that he was righteous by offering a sacrifice in faith according to the revelation that God had given to him.
..........................Hebrews 11:4
"By faith Abel offered unto God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaketh"